Skip to content

Commit acc2528

Browse files
committed
[llvm] Fix cmake string expansion in CrossCompile.cmake
This fixes an issue where builds on Windows with LLVM_OPTIMIZED_TABLEGEN will fail if CMAKE_MAKE_PROGRAM, CMAKE_C_COMPILER_LAUNCHER or CMAKE_CXX_COMPILER_LAUNCHER are lists rather than paths to a binary; this occurs when one of these programs is passed with arguments instead of just as a path. On non-Windows this works regardless as the sub-cmake command runs in a proper shell, but on Windows it runs differently and so these strings need to be expanded correctly by cmake.
1 parent 3275291 commit acc2528

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/cmake/modules/CrossCompile.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
8383

8484
add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt
8585
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
86-
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
87-
-DCMAKE_C_COMPILER_LAUNCHER="${CMAKE_C_COMPILER_LAUNCHER}"
88-
-DCMAKE_CXX_COMPILER_LAUNCHER="${CMAKE_CXX_COMPILER_LAUNCHER}"
86+
"-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}"
87+
"-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}"
88+
"-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}"
8989
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_CURRENT_SOURCE_DIR}
9090
${CROSS_TOOLCHAIN_FLAGS_${project_name}_${target_name}}
9191
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE

0 commit comments

Comments
 (0)