From: Shoaib Meenai Date: Fri, 30 Nov 2018 00:30:53 +0000 (+0000) Subject: [CMake] build correctly if build path contains whitespace X-Git-Tag: llvmorg-8.0.0-rc1~3254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eb01f99fb87b0d1f87ce998ae13c9fca5bd039d;p=platform%2Fupstream%2Fllvm.git [CMake] build correctly if build path contains whitespace The add_llvm_symbol_exports function in AddLLVM.cmake creates command line link flags with paths containing CMAKE_CURRENT_BINARY_DIR, but that will break if CMAKE_CURRENT_BINARY_DIR contains whitespace. This patch adds quotes to those paths. Fixes PR39843. Patch by John Garvin. Differential Revision: https://reviews.llvm.org/D55081 llvm-svn: 347937 --- diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 4964a35..02ce547 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -73,7 +73,7 @@ function(add_llvm_symbol_exports target_name export_file) VERBATIM COMMENT "Creating export file for ${target_name}") set_property(TARGET ${target_name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") + LINK_FLAGS " -Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"") elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX") set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-bE:${export_file}") @@ -93,10 +93,10 @@ function(add_llvm_symbol_exports target_name export_file) COMMENT "Creating export file for ${target_name}") if (${LLVM_LINKER_IS_SOLARISLD}) set_property(TARGET ${target_name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") + LINK_FLAGS " -Wl,-M,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"") else() set_property(TARGET ${target_name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}") + LINK_FLAGS " -Wl,--version-script,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"") endif() else() set(native_export_file "${target_name}.def")