From 483c68d87c27ac702f3722e3a02f81e9c9fc3974 Mon Sep 17 00:00:00 2001
From: Nick Zavaritsky <mejedi@gmail.com>
Date: Fri, 29 Jul 2016 14:46:50 +0300
Subject: [PATCH] Fix #1645: Warnings related to MACOSX_RPATH

---
 cmake/os.cmake | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cmake/os.cmake b/cmake/os.cmake
index e33847da76..f57138905f 100644
--- a/cmake/os.cmake
+++ b/cmake/os.cmake
@@ -44,6 +44,15 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
     find_package_message(PLATFORM "Building for OS X" "${CMAKE_SYSTEM_NAME}")
     find_package_message(DARWIN_BUILD_TYPE
         "DARWIN_BUILD_TYPE: ${DARWIN_BUILD_TYPE}" "${DARWIN_BUILD_TYPE}")
+
+    # In Mac OS, the dynamic linker recognizes
+    # @loader_path, @executable_path and @rpath tokens, ex:
+    #   '@loder_path/lit.dylib'
+    # means load lit from the same dir the requesting binary lives in.
+    # Since our dynamic libraries aren't intended for static linking,
+    # this is pretty much irrelevant. Disable CMake rpath features
+    # altogether. Suppresses a few warnings.
+    set(CMAKE_SKIP_RPATH true)
 else()
     message (FATAL_ERROR "Unsupported platform -- ${CMAKE_SYSTEM_NAME}")
 endif()
-- 
GitLab