Skip to content

Commit ffec63b

Browse files
authored
[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.
1 parent af9a247 commit ffec63b

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
@@ -293,7 +293,7 @@ function(llvm_ExternalProject_Add name source_dir)
293293
endif()
294294
set(flag_types ASM C CXX MODULE_LINKER SHARED_LINKER EXE_LINKER)
295295
foreach(type ${flag_types})
296-
set(${type}_flag -DCMAKE_${type}_FLAGS=-resource-dir=${resource_dir})
296+
set(${type}_flag -DCMAKE_${type}_FLAGS_INIT=-resource-dir=${resource_dir})
297297
endforeach()
298298
string(REPLACE ";" "|" flag_string "${flag_types}")
299299
foreach(arg ${ARG_CMAKE_ARGS})

0 commit comments

Comments
 (0)