summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-02-08 03:50:18 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-02-08 03:50:18 +0000
commit163333f9122b259f1f09ca8814b119a3ecb24262 (patch)
treea04c25e4f485083897c617eb64a8e01814cfaff9
parent4918702542c22f8ba51e600767d4bb30045230db (diff)
downloadbcm5719-llvm-163333f9122b259f1f09ca8814b119a3ecb24262.tar.gz
bcm5719-llvm-163333f9122b259f1f09ca8814b119a3ecb24262.zip
build: silence warnings in in-tree build
Avoid the developer warnings from cmake when configuring libc++ as part of the LLVM layout. Setup the custom macro paths earlier to re-use the detection logic prior to setting the project properties. llvm-svn: 260071
-rw-r--r--libcxx/CMakeLists.txt31
1 files changed, 17 insertions, 14 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index e6c96f64711..9387f7c94c4 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -12,13 +12,6 @@ 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"
@@ -26,15 +19,18 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
-# Require out of source build.
-include(MacroEnsureOutOfSourceBuild)
-MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
- "${PROJECT_NAME} requires an out of source build. Please create a separate
- 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)
+ 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")
+endif ()
+
if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
"llvm-config not found and LLVM_PATH not defined.\n"
@@ -42,6 +38,13 @@ if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
"or -DLLVM_PATH=path/to/llvm-source-root.")
endif()
+# Require out of source build.
+include(MacroEnsureOutOfSourceBuild)
+MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
+ "${PROJECT_NAME} requires an out of source build. Please create a separate
+ build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
+ )
+
#===============================================================================
# Setup CMake Options
#===============================================================================
OpenPOWER on IntegriCloud