[llvm-dev] [PATCH] CrossCompile: Escape LLVM_TARGET variable properly

Ricardo Ribalda Delgado via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 14 04:45:15 PDT 2016


Without this patch, if the user provides a list of targets such as
-DLLVM_TARGETS_TO_BUILD=a,b the NATIVE cross compilation folder will
only contain target a, due to the way cmake parses variables.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda at gmail.com>
---
 cmake/modules/CrossCompile.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/modules/CrossCompile.cmake b/cmake/modules/CrossCompile.cmake
index 9c598a6a07b0..65f2e70626ba 100644
--- a/cmake/modules/CrossCompile.cmake
+++ b/cmake/modules/CrossCompile.cmake
@@ -42,7 +42,7 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)
       set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
     endif()
     execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags}
-        -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
+        -G "${CMAKE_GENERATOR}" "-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}"
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
       WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} )
-- 
2.9.3



More information about the llvm-dev mailing list