[PATCH] D31144: Respect cmake link flags when compiling test files

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 11:13:27 PDT 2017


fjricci created this revision.
Herald added a subscriber: mgorny.

Makes sure that calls to try_compile run with user-supplied
additional linker flags

Change-Id: I3929e9e37bcb82e0f67e52c12fd32d5a566f8854


https://reviews.llvm.org/D31144

Files:
  cmake/Modules/CompilerRTDarwinUtils.cmake


Index: cmake/Modules/CompilerRTDarwinUtils.cmake
===================================================================
--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -81,7 +81,7 @@
   set(working_archs)
   foreach(arch ${archs})
    
-    set(arch_linker_flags "-arch ${arch} ${os_linker_flags}")
+    set(arch_linker_flags "-arch ${arch} ${os_linker_flags} ${CMAKE_EXE_LINKER_FLAGS}")
     if(TEST_COMPILE_ONLY)
       try_compile_only(CAN_TARGET_${os}_${arch} -v -arch ${arch} ${DARWIN_${os}_CFLAGS})
     else()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31144.92364.patch
Type: text/x-patch
Size: 561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170320/ef69c111/attachment.bin>


More information about the llvm-commits mailing list