Skip to content

Commit 1a32a7b

Browse files
committed
[cmake] Pass -resource-dir to external projects as CMAKE_<LANG>_FLAGS_INIT instead of as a force override
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's won't be required.
1 parent 1d06f41 commit 1a32a7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/cmake/modules/LLVMExternalProjectUtils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function(llvm_ExternalProject_Add name source_dir)
287287
endif()
288288
set(flag_types ASM C CXX MODULE_LINKER SHARED_LINKER EXE_LINKER)
289289
foreach(type ${flag_types})
290-
set(${type}_flag -DCMAKE_${type}_FLAGS=-resource-dir=${resource_dir})
290+
set(${type}_flag -DCMAKE_${type}_FLAGS_INIT=-resource-dir=${resource_dir})
291291
endforeach()
292292
string(REPLACE ";" "|" flag_string "${flag_types}")
293293
foreach(arg ${ARG_CMAKE_ARGS})

0 commit comments

Comments
 (0)