summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-11-30 00:30:53 +0000
committerShoaib Meenai <smeenai@fb.com>2018-11-30 00:30:53 +0000
commit3eb01f99fb87b0d1f87ce998ae13c9fca5bd039d (patch)
treec5dc9e04c0717a49f9880cd9ec8087fe2c425d5d /llvm/cmake
parentc651e79c4a948940b117daf07b2c0087590cb6e0 (diff)
downloadbcm5719-llvm-3eb01f99fb87b0d1f87ce998ae13c9fca5bd039d.tar.gz
bcm5719-llvm-3eb01f99fb87b0d1f87ce998ae13c9fca5bd039d.zip
[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
Diffstat (limited to 'llvm/cmake')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 4964a35071e..02ce5479c10 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")
OpenPOWER on IntegriCloud