mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,13 +12,6 @@ if(POLICY CMP0022)
|
|||||||
cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
|
cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
|
||||||
endif()
|
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
|
# Add path for custom modules
|
||||||
set(CMAKE_MODULE_PATH
|
set(CMAKE_MODULE_PATH
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||||
@@ -26,15 +19,18 @@ set(CMAKE_MODULE_PATH
|
|||||||
${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.
|
# Find the LLVM sources and simulate LLVM CMake options.
|
||||||
include(HandleOutOfTreeLLVM)
|
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)
|
if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
|
||||||
message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
|
message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
|
||||||
"llvm-config not found and LLVM_PATH not defined.\n"
|
"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.")
|
"or -DLLVM_PATH=path/to/llvm-source-root.")
|
||||||
endif()
|
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
|
# Setup CMake Options
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user