diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-01-19 09:45:07 +0300 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-01-20 21:59:17 +0300 |
commit | df31ff1b29bc4c2308ec5df8a7ff0ec2ab0942d4 (patch) | |
tree | 159a5c483a888749edd6e0840429ba43e7d73b5c /libcxxabi | |
parent | c65186c89f35b7b599c41183def666a2bde62ddd (diff) |
[cmake] Make include(GNUInstallDirs) always below project(..)
Its defaulting logic must go after `project(..)` to work correctly, but `project(..)` is often in a standalone condition making this
awkward, since the rest of the condition code may also need GNUInstallDirs.
The good thing is there are the various standalone booleans, which I had missed before. This makes splitting the conditional blocks less awkward.
Reviewed By: arichardson, phosek, beanz, ldionne, #libunwind, #libc, #libc_abi
Differential Revision: https://reviews.llvm.org/D117639
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/CMakeLists.txt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 78f486418af7..ecbc7091864e 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -10,8 +10,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -include(GNUInstallDirs) - set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") # Add path for custom modules @@ -37,17 +35,21 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_B set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") + set(LIBCXXABI_STANDALONE_BUILD TRUE) + # In a standalone build, we don't have llvm to automatically generate the # llvm-lit script for us. So we need to provide an explicit directory that # the configurator should write the script into. - set(LIBCXXABI_STANDALONE_BUILD 1) set(LLVM_LIT_OUTPUT_DIR "${LIBCXXABI_BINARY_DIR}/bin") +endif() +# Must go below project(..) +include(GNUInstallDirs) + +if (LIBCXXABI_STANDALONE_BUILD) # Find the LLVM sources and simulate LLVM CMake options. include(HandleOutOfTreeLLVM) -endif() -if (LIBCXXABI_STANDALONE_BUILD) find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) message(WARNING "Python3 not found, using python2 as a fallback") |