[PATCH] D18007: [test-suite] Append LDFLAGS to LINK_LIBRARIES

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 13:05:11 PST 2016


mcrosier retitled this revision from "[test-suite] Use target_link_libraries for libs" to "[test-suite] Append LDFLAGS to LINK_LIBRARIES".
mcrosier updated the summary for this revision.
mcrosier updated this revision to Diff 50339.
mcrosier added a comment.

Update based on Matthias' comments.


http://reviews.llvm.org/D18007

Files:
  cmake/modules/SingleMultiSource.cmake

Index: cmake/modules/SingleMultiSource.cmake
===================================================================
--- cmake/modules/SingleMultiSource.cmake
+++ cmake/modules/SingleMultiSource.cmake
@@ -61,7 +61,11 @@
     string(REPLACE " " "\\ " quoted "${ARGN}")
     string(REPLACE "\"" "\\\"" quoted "${quoted}")
     string(REPLACE ";" " " quoted "${quoted}")
-    set_target_properties(${target} PROPERTIES ${propertyname} "${old_flags} ${quoted}")
+    # Ensure that there is no leading or trailing whitespace
+    # This is especially important if old_flags is empty and the property
+    # is LINK_LIBRARIES, as extra whitespace violates CMP0004
+    string(STRIP "${old_flags} ${quoted}" new_flags)
+    set_target_properties(${target} PROPERTIES ${propertyname} "${new_flags}")
   endif()
 endmacro()
 
@@ -70,7 +74,7 @@
 endmacro()
 
 macro(append_link_flags target)
-  append_target_flags(LINK_FLAGS ${target} ${ARGN})
+  append_target_flags(LINK_LIBRARIES ${target} ${ARGN})
 endmacro()
 
 # llvm_add_test - Create a .test driver file suitable for LIT.
@@ -236,4 +240,4 @@
     set(TESTSCRIPT "${TESTSCRIPT}METRIC: ${ARGS_METRIC}: ${JOINED_ARGUMENTS}\n")
   endif()
 endmacro()
-  
\ No newline at end of file
+  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18007.50339.patch
Type: text/x-patch
Size: 1227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/beb5f7a8/attachment.bin>


More information about the llvm-commits mailing list