diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-11-14 02:43:12 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-11-14 02:43:12 +0000 |
commit | 28349f9bf20bab6af6555cbfe6ef611e3afbf8a6 (patch) | |
tree | 4fcbfe3b9fbe917e80a37d5eff6e6a06b0646cc2 /libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake | |
parent | f13ad102080e51bc68da9e67542ddc9fd6cc168f (diff) | |
download | bcm5719-llvm-28349f9bf20bab6af6555cbfe6ef611e3afbf8a6.tar.gz bcm5719-llvm-28349f9bf20bab6af6555cbfe6ef611e3afbf8a6.zip |
Add check-cxx-abilist target when supported.
This patch adds a `check-cxx-abilist` target which verifies the libc++.so ABI
when the current build configuration matches the configuration used to generate
the ABI lists.
In order to make this change `HandleOutOfTreeLLVM.cmake` needed to be modified
to include `LLVMConfig.cmake` so that `TARGET_TRIPLE` is defined. Hopefully
the changes needed to accommodate this won't break existing build
configurations.
llvm-svn: 286789
Diffstat (limited to 'libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake')
-rw-r--r-- | libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake index 05b0244c3b5..599d8a1d4b2 100644 --- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -11,6 +11,7 @@ macro(find_llvm_parts) set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules") elseif(LLVM_CONFIG_PATH) message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}") + set(LIBCXX_USING_INSTALLED_LLVM 1) set(CONFIG_COMMAND ${LLVM_CONFIG_PATH} "--includedir" "--prefix" @@ -56,21 +57,28 @@ macro(find_llvm_parts) set(LLVM_FOUND ON) endmacro(find_llvm_parts) -# If this is a standalone build not running as an external project of LLVM -# we need to later make some decisions differently. -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # The intent is that this doesn't necessarily mean the LLVM is installed (it - # could be a build directory), but it means we need to treat the LLVM - # directory as read-only. - set(LIBCXX_USING_INSTALLED_LLVM 1) -endif() - -if (LIBCXX_USING_INSTALLED_LLVM OR LIBCXX_STANDALONE_BUILD) - set(LIBCXX_STANDALONE_BUILD 1) +macro(configure_out_of_tree_llvm) message(STATUS "Configuring for standalone build.") + set(LIBCXX_STANDALONE_BUILD 1) find_llvm_parts() + # Add LLVM Functions -------------------------------------------------------- + if (LLVM_FOUND AND LIBCXX_USING_INSTALLED_LLVM) + include(LLVMConfig) # For TARGET_TRIPLE + else() + if (WIN32) + set(LLVM_ON_UNIX 0) + set(LLVM_ON_WIN32 1) + else() + set(LLVM_ON_UNIX 1) + set(LLVM_ON_WIN32 0) + endif() + endif() + if (LLVM_FOUND) + include(AddLLVM OPTIONAL) + endif() + # LLVM Options -------------------------------------------------------------- include(FindPythonInterp) if( NOT PYTHONINTERP_FOUND ) @@ -103,30 +111,11 @@ if (LIBCXX_USING_INSTALLED_LLVM OR LIBCXX_STANDALONE_BUILD) find_package(Sphinx REQUIRED) endif() - # FIXME - This is cribbed from HandleLLVMOptions.cmake. - if(WIN32) + if (LLVM_ON_UNIX AND NOT APPLE) + set(LLVM_HAVE_LINK_VERSION_SCRIPT 1) + else() set(LLVM_HAVE_LINK_VERSION_SCRIPT 0) - if(CYGWIN) - set(LLVM_ON_WIN32 0) - set(LLVM_ON_UNIX 1) - else(CYGWIN) - set(LLVM_ON_WIN32 1) - set(LLVM_ON_UNIX 0) - endif(CYGWIN) - else(WIN32) - if(UNIX) - set(LLVM_ON_WIN32 0) - set(LLVM_ON_UNIX 1) - if(APPLE) - set(LLVM_HAVE_LINK_VERSION_SCRIPT 0) - else(APPLE) - set(LLVM_HAVE_LINK_VERSION_SCRIPT 1) - endif(APPLE) - else(UNIX) - MESSAGE(SEND_ERROR "Unable to determine platform") - endif(UNIX) - endif(WIN32) + endif() +endmacro(configure_out_of_tree_llvm) - # Add LLVM Functions -------------------------------------------------------- - include(AddLLVM OPTIONAL) -endif() +configure_out_of_tree_llvm() |