diff options
| author | Eric Fiselier <eric@efcs.ca> | 2015-12-30 03:39:03 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2015-12-30 03:39:03 +0000 |
| commit | d888cf50c6ab8475c80ec2079dc11b3a6b923595 (patch) | |
| tree | b0989c82d70f54672f999d4a6442448559e4d25d | |
| parent | b9518f8f86f8f729a9e6b9771b0d08b39d4e580d (diff) | |
| download | bcm5719-llvm-d888cf50c6ab8475c80ec2079dc11b3a6b923595.tar.gz bcm5719-llvm-d888cf50c6ab8475c80ec2079dc11b3a6b923595.zip | |
Revert r256606 due to compiler-rt sanitizer bot failures
llvm-svn: 256614
| -rw-r--r-- | libcxx/CMakeLists.txt | 34 | ||||
| -rw-r--r-- | libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake | 41 |
2 files changed, 27 insertions, 48 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index fc7267e2de2..e6c96f64711 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -12,29 +12,20 @@ if(POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang endif() +project(libcxx CXX C) + +set(PACKAGE_NAME libcxx) +set(PACKAGE_VERSION trunk-svn) +set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") + # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" - ${CMAKE_MODULE_PATH} + ${CMAKE_MODULE_PATH} ) -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - project(libcxx CXX C) - set(PACKAGE_NAME libcxx) - set(PACKAGE_VERSION trunk-svn) - set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") - set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") - - # Configure for a standalone build - message(STATUS "Configuring for standalone build.") - set(LIBCXX_BUILT_STANDALONE 1) - - # Find the LLVM sources and simulate LLVM CMake options. - include(HandleOutOfTreeLLVM) - handle_out_of_tree_llvm() -endif() - # Require out of source build. include(MacroEnsureOutOfSourceBuild) MACRO_ENSURE_OUT_OF_SOURCE_BUILD( @@ -42,6 +33,15 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD( build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there." ) +# Find the LLVM sources and simulate LLVM CMake options. +include(HandleOutOfTreeLLVM) +if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND) + message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " + "llvm-config not found and LLVM_PATH not defined.\n" + "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " + "or -DLLVM_PATH=path/to/llvm-source-root.") +endif() + #=============================================================================== # Setup CMake Options #=============================================================================== diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake index 29347dc8fe1..6215be7f586 100644 --- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -1,6 +1,4 @@ - - -macro(internal_find_llvm_parts) +macro(find_llvm_parts) # Rely on llvm-config. set(CONFIG_OUTPUT) find_program(LLVM_CONFIG "llvm-config") @@ -59,13 +57,16 @@ macro(internal_find_llvm_parts) list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules") set(LLVM_FOUND ON) -endmacro(internal_find_llvm_parts) +endmacro(find_llvm_parts) -macro(internal_simulate_llvm_options) - # LLVM Options -------------------------------------------------------------- - # Configure the LLVM CMake options expected by libc++. +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(LIBCXX_BUILT_STANDALONE 1) + message(STATUS "Configuring for standalone build.") + find_llvm_parts() + + # LLVM Options -------------------------------------------------------------- include(FindPythonInterp) if( NOT PYTHONINTERP_FOUND ) message(WARNING "Failed to find python interpreter. " @@ -131,29 +132,7 @@ macro(internal_simulate_llvm_options) MESSAGE(SEND_ERROR "Unable to determine platform") endif(UNIX) endif(WIN32) -endmacro(internal_simulate_llvm_options) - - -macro(handle_out_of_tree_llvm) - # This macro should not be called unless we are building out of tree. - # Enforce that. - if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - message(FATAL_ERROR "libc++ incorrectly configured for out-of-tree LLVM") - endif() - - # Attempt to find an LLVM installation and source directory. Warn if they - # are not found. - internal_find_llvm_parts() - if (NOT LLVM_FOUND) - message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " - "llvm-config not found and LLVM_PATH not defined.\n" - "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " - "or -DLLVM_PATH=path/to/llvm-source-root.") - endif() - - # Simulate the LLVM CMake options and variables provided by an in-tree LLVM. - internal_simulate_llvm_options() - # Additionally include the LLVM CMake functions if we can find the module. + # Add LLVM Functions -------------------------------------------------------- include(AddLLVM OPTIONAL) -endmacro() +endif() |

