Skip to content

Commit f956bfe

Browse files
authored
[llvm][cmake] Use $<CONFIG> instead of ${CMAKE_CFG_INTDIR} for llvm-config (llvm#75417)
${CMAKE_CFG_INTDIR} does not work correctly for llvm-config when building with the Ninja Multi-Config generator. It tries to find files in the ${CONFIGURATION} directory. Using the $<CONFIG> generator expression instead fixes this. Really this needs to be done everywhere as ${CMAKE_CFG_INTDIR} is deprecated as of 3.21 (LLVM's current min version is 3.20), but this is sufficient to get `check-llvm` to pass. See https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html
1 parent 23ccb02 commit f956bfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/tools/llvm-config/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ llvm_expand_pseudo_components(LLVM_DYLIB_COMPONENTS_expanded "${LLVM_DYLIB_COMPO
8080
configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
8181

8282
# Set build-time environment(s).
83-
add_compile_definitions(CMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}")
83+
add_compile_definitions(CMAKE_CFG_INTDIR="$<CONFIG>")
8484

8585
if(LLVM_ENABLE_MODULES)
8686
target_compile_options(llvm-config PUBLIC

0 commit comments

Comments
 (0)