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

Summary: 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.

Reviewers: samsonov, zaks.anna

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17556

llvm-svn: 261797
This commit is contained in:
Chris Bieneman 2016-02-24 22:29:42 +00:00
parent 619427658f
commit 956eceae9f

View File

@ -31,6 +31,9 @@ if(CMAKE_VERSION VERSION_LESS 2.8.12)
# 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)
@ -38,6 +41,9 @@ else()
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.