Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -32,6 +32,15 @@ include(HandleOutOfTreeLLVM) endif() +if (LIBCXX_STANDALONE_BUILD) + include(FindPythonInterp) + if( NOT PYTHONINTERP_FOUND ) + message(WARNING "Failed to find python interpreter. " + "The libc++ test suite will be disabled.") + set(LLVM_INCLUDE_TESTS OFF) + endif() +endif() + # Require out of source build. include(MacroEnsureOutOfSourceBuild) MACRO_ENSURE_OUT_OF_SOURCE_BUILD( Index: cmake/Modules/HandleOutOfTreeLLVM.cmake =================================================================== --- cmake/Modules/HandleOutOfTreeLLVM.cmake +++ cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -84,13 +84,6 @@ endif() # LLVM Options -------------------------------------------------------------- - include(FindPythonInterp) - if( NOT PYTHONINTERP_FOUND ) - message(WARNING "Failed to find python interpreter. " - "The libc++ test suite will be disabled.") - set(LLVM_INCLUDE_TESTS OFF) - endif() - if (NOT DEFINED LLVM_INCLUDE_TESTS) set(LLVM_INCLUDE_TESTS ${LLVM_FOUND}) endif()