[PATCH] D54236: [cmake] Set CMP0075 to NEW

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 15:46:22 PST 2018


smeenai created this revision.
smeenai added reviewers: beanz, phosek.
Herald added a subscriber: mgorny.
smeenai added a comment.

Somewhat orthogonal to this diff, but should we change clang so that it only does its own cmake_minimum_required call when it's being built standalone? There's potential for inconsistent policies between building clang in-tree and standalone if we do that, but it also seems strange to just wholesale ignore LLVM's policy settings.


Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results (and I did clean configures before and after this change and
confirmed that the resulting CMake caches were identical, though of
course that's just one machine). This suppresses a warning when building
with CMake 3.12 or later.

Unfortunately, this doesn't suppress the warning in clang, because clang
does its own cmake_minimum_required call even when being built in-tree,
and that resets all policy settings.


Repository:
  rL LLVM

https://reviews.llvm.org/D54236

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,6 +7,10 @@
   set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
 endif()
 
+if(POLICY CMP0075)
+  cmake_policy(SET CMP0075 NEW)
+endif()
+
 if(NOT DEFINED LLVM_VERSION_MAJOR)
   set(LLVM_VERSION_MAJOR 8)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54236.173061.patch
Type: text/x-patch
Size: 339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/619fd0c1/attachment.bin>


More information about the llvm-commits mailing list