[CMake][libcxx] Move Python check to main CMake file

This is to make sure this check is called even when building as
part of LLVM runtimes when we are doing standalone but not out of
tree build.

Differential Revision: https://reviews.llvm.org/D28392

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291592 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Petr Hosek 2017-01-10 19:51:17 +00:00
parent bd7c88461b
commit 39441fe9f0
2 changed files with 9 additions and 7 deletions

View File

@ -32,6 +32,15 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(HandleOutOfTreeLLVM) include(HandleOutOfTreeLLVM)
endif() 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. # Require out of source build.
include(MacroEnsureOutOfSourceBuild) include(MacroEnsureOutOfSourceBuild)
MACRO_ENSURE_OUT_OF_SOURCE_BUILD( MACRO_ENSURE_OUT_OF_SOURCE_BUILD(

View File

@ -95,13 +95,6 @@ macro(configure_out_of_tree_llvm)
endif() endif()
# LLVM Options -------------------------------------------------------------- # 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) if (NOT DEFINED LLVM_INCLUDE_TESTS)
set(LLVM_INCLUDE_TESTS ${LLVM_FOUND}) set(LLVM_INCLUDE_TESTS ${LLVM_FOUND})
endif() endif()