[PATCH] D139536: [runtimes] Don't override LLVM_ENABLE_PER_TARGET_RUNTIME_DIR set from llvm
David Spickett via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 02:54:23 PST 2022
DavidSpickett updated this revision to Diff 482772.
DavidSpickett added a comment.
- Move code to a macro
- Use it in more functions that I hit testing the release build
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139536/new/
https://reviews.llvm.org/D139536
Files:
llvm/runtimes/CMakeLists.txt
Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -60,14 +60,22 @@
endforeach()
endfunction()
+macro(set_enable_per_target_runtime_dir)
+ # May have been set by llvm/CMakeLists.txt.
+ if (NOT DEFINED LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
+ # AIX should fold 32-bit & 64-bit arch libraries into a single archive.
+ if (LLVM_TARGET_TRIPLE MATCHES "aix")
+ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF)
+ else()
+ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON)
+ endif()
+ endif()
+endmacro()
+
function(builtin_default_target compiler_rt_path)
cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN})
- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
- # AIX should fold 32-bit & 64-bit arch libraries into a single archive.
- if (LLVM_TARGET_TRIPLE MATCHES "aix")
- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)
- endif()
+ set_enable_per_target_runtime_dir()
llvm_ExternalProject_Add(builtins
${compiler_rt_path}/lib/builtins
@@ -75,7 +83,7 @@
CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
-DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR}
-DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
${COMMON_CMAKE_ARGS}
@@ -216,11 +224,7 @@
list(APPEND test_targets runtimes-test-depends check-runtimes)
endif()
- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
- # AIX should fold 32-bit & 64-bit arch libraries into a single archive.
- if (LLVM_TARGET_TRIPLE MATCHES "aix")
- set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)
- endif()
+ set_enable_per_target_runtime_dir()
llvm_ExternalProject_Add(runtimes
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
@@ -230,7 +234,7 @@
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
-DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR}
-DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_CXX_COMPILER_WORKS=ON
@@ -347,6 +351,8 @@
list(APPEND ${name}_extra_args -DLLVM_USE_LINKER=${LLVM_USE_LINKER})
endif()
+ set_enable_per_target_runtime_dir()
+
llvm_ExternalProject_Add(runtimes-${name}
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
DEPENDS ${${name}_deps}
@@ -355,7 +361,7 @@
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DLLVM_DEFAULT_TARGET_TRIPLE=${target}
-DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_CXX_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139536.482772.patch
Type: text/x-patch
Size: 4060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221214/00e8b4ee/attachment.bin>
More information about the llvm-commits
mailing list