This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Set CMP0075 to NEW
ClosedPublic

Authored by smeenai on Nov 7 2018, 3:44 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Nov 7 2018, 3:44 PM

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.

beanz accepted this revision.Nov 7 2018, 4:07 PM

LGTM.

My biggest argument against changing how clang does things is that we want to get the policy failures there too so that we know to fix them. We do support building clang out of tree, and hiding the warnings for in-tree builds will just make it harder to find and fix them.

This revision is now accepted and ready to land.Nov 7 2018, 4:07 PM

That's fair. I can just change the policy for clang explicitly in a separate diff then.

This revision was automatically updated to reflect the committed changes.