[PATCH] D42463: [cmake] Set cmake policy CMP0068 to suppress warnings on OSX
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 23 21:52:16 PST 2018
hintonda created this revision.
hintonda added reviewers: beanz, compnerd, phosek, EricWF.
Herald added subscribers: llvm-commits, mgorny.
Set cmake policy CMP0068=NEW, if available, and add target property
"BUILD_WITH_INSTALL_NAME_DIR On" to maintain current behavior.
This is needed to suppress warnings on OSX starting with cmake version
3.9.6.
Repository:
rL LLVM
https://reviews.llvm.org/D42463
Files:
CMakeLists.txt
cmake/modules/AddLLVM.cmake
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1598,7 +1598,12 @@
return()
endif()
+ if(CMAKE_POLICY_DEFAULT_CMP0068)
+ set(install_name_dir_property "BUILD_WITH_INSTALL_NAME_DIR On")
+ endif()
+
set_target_properties(${name} PROPERTIES
+ ${install_name_dir_property}
BUILD_WITH_INSTALL_RPATH On
INSTALL_RPATH "${_install_rpath}"
${_install_name_dir})
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -17,6 +17,10 @@
cmake_policy(SET CMP0057 NEW)
+if(POLICY CMP0068)
+ cmake_policy(SET CMP0068 NEW)
+endif()
+
if(NOT DEFINED LLVM_VERSION_MAJOR)
set(LLVM_VERSION_MAJOR 7)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42463.131199.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/0c287d3d/attachment.bin>
More information about the llvm-commits
mailing list