[PATCH] D17556: [CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 17:06:18 PST 2016


beanz created this revision.
beanz added reviewers: samsonov, zaks.anna.
beanz added a subscriber: llvm-commits.

Building the sanitizer libraries without rpaths causes all sorts of problems when you try to use them. This simple fix should make it all work.

http://reviews.llvm.org/D17556

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -31,13 +31,19 @@
   # Invalidate a couple of keywords.
   set(cmake_2_8_12_INTERFACE)
   set(cmake_2_8_12_PRIVATE)
+  if(APPLE)
+    set(CMAKE_MACOSX_RPATH On)
+  endif
 else()
   # Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries().
   set(cmake_2_8_12_INTERFACE INTERFACE)
   set(cmake_2_8_12_PRIVATE PRIVATE)
   if(POLICY CMP0022)
     cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
   endif()
+  if(POLICY CMP0042)
+    cmake_policy(SET CMP0042 NEW) # automatic when 2.8.12 is required
+  endif()
 endif()
 
 # Top level target used to build all compiler-rt libraries.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17556.48862.patch
Type: text/x-patch
Size: 745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160224/410aefb2/attachment.bin>


More information about the llvm-commits mailing list