diff options
Diffstat (limited to 'libcxx/CMakeLists.txt')
| -rw-r--r-- | libcxx/CMakeLists.txt | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index e6c96f64711..fc7267e2de2 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -12,20 +12,29 @@ 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( @@ -33,15 +42,6 @@ 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 #=============================================================================== |

