diff options
author | Raul Tambre <raul@tambre.ee> | 2024-06-03 19:46:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 19:46:06 +0300 |
commit | ffec63b6a54f719976443cc17b6226030be17c52 (patch) | |
tree | 11900dfe89357a8f3649b7a70a34119ef712778d | |
parent | af9a247990b10e2be4f3d691c1a967b46acdf7f8 (diff) | |
download | llvm-ffec63b6a54f719976443cc17b6226030be17c52.zip llvm-ffec63b6a54f719976443cc17b6226030be17c52.tar.gz llvm-ffec63b6a54f719976443cc17b6226030be17c52.tar.bz2 |
[cmake] Pass -resource-dir to external projects as CMAKE_<LANG>_FLAGS_INIT instead of as a force override (#87330)
It's useful to use toolchain files for configuring runtimes builds.
Setting `CMAKE_<LANG>_FLAGS` is however forceful and precludes initialization from the _INIT variant meant to be set by toolchains.
The toolchain file still needs to append instead of just setting and be idempotent (`include_guard()`), but this way at least a special toolchain to account for LLVM won't be required.
-rw-r--r-- | llvm/cmake/modules/LLVMExternalProjectUtils.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake index 60aed21..740645a 100644 --- a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake +++ b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake @@ -293,7 +293,7 @@ function(llvm_ExternalProject_Add name source_dir) endif() set(flag_types ASM C CXX MODULE_LINKER SHARED_LINKER EXE_LINKER) foreach(type ${flag_types}) - set(${type}_flag -DCMAKE_${type}_FLAGS=-resource-dir=${resource_dir}) + set(${type}_flag -DCMAKE_${type}_FLAGS_INIT=-resource-dir=${resource_dir}) endforeach() string(REPLACE ";" "|" flag_string "${flag_types}") foreach(arg ${ARG_CMAKE_ARGS}) |