[PATCH] D55081: [CMake] build correctly if build path contains whitespace (https://bugs.llvm.org/show_bug.cgi?id=39843)
John Garvin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 29 14:59:13 PST 2018
johngarvin created this revision.
johngarvin added a reviewer: chandlerc.
Herald added subscribers: llvm-commits, mgorny.
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.
Repository:
rL LLVM
https://reviews.llvm.org/D55081
Files:
cmake/modules/AddLLVM.cmake
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -73,7 +73,7 @@
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 @@
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")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55081.175970.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181129/6da728da/attachment.bin>
More information about the llvm-commits
mailing list