summaryrefslogtreecommitdiff
path: root/pstl
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-19 06:45:07 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-20 18:59:17 +0000
commitdf31ff1b29bc4c2308ec5df8a7ff0ec2ab0942d4 (patch)
tree159a5c483a888749edd6e0840429ba43e7d73b5c /pstl
parentc65186c89f35b7b599c41183def666a2bde62ddd (diff)
downloadllvm-df31ff1b29bc4c2308ec5df8a7ff0ec2ab0942d4.tar.gz
[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 'pstl')
-rw-r--r--pstl/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
index 8784eb07b574..2461522349ee 100644
--- a/pstl/CMakeLists.txt
+++ b/pstl/CMakeLists.txt
@@ -7,8 +7,6 @@
#===----------------------------------------------------------------------===##
cmake_minimum_required(VERSION 3.13.4)
-include(GNUInstallDirs)
-
set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
@@ -18,6 +16,9 @@ math(EXPR VERSION_PATCH "(${PARALLELSTL_VERSION_SOURCE} % 10)")
project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX)
+# Must go below project(..)
+include(GNUInstallDirs)
+
set(PSTL_PARALLEL_BACKEND "serial" CACHE STRING "Threading backend to use. Valid choices are 'serial', 'omp', and 'tbb'. The default is 'serial'.")
set(PSTL_HIDE_FROM_ABI_PER_TU OFF CACHE BOOL "Whether to constrain ABI-unstable symbols to each translation unit (basically, mark them with C's static keyword).")
set(_PSTL_HIDE_FROM_ABI_PER_TU ${PSTL_HIDE_FROM_ABI_PER_TU}) # For __pstl_config_site