This is an archive of the discontinued LLVM Phabricator instance.

[llvm][cmake] Shore up `llvm_check_linker_flags`.
ClosedPublic

Authored by Ericson2314 on Jan 29 2022, 4:08 PM.

Details

Summary

Ensure CMAKE_EXE_LINKER_FLAGS effects the underlying try_compile by setting
this policy to use the new, non-deprecated behavior, without effecting the
caller.

Normally this shouldn't be necessary, as CMake uses
cmake_minimum_required(VERSION 3.13.4) consistently, but I suppose
this could rear its head in a downstream project?

Diff Detail

Event Timeline

Ericson2314 created this revision.Jan 29 2022, 4:08 PM
Ericson2314 requested review of this revision.Jan 29 2022, 4:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2022, 4:08 PM
sebastian-ne accepted this revision.Jul 25 2022, 4:48 AM
sebastian-ne added a subscriber: sebastian-ne.

Looks reasonable to me. The function is pretty useless without this policy.

This revision is now accepted and ready to land.Jul 25 2022, 4:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 4:48 AM
This revision was landed with ongoing or failed builds.Jul 25 2022, 9:02 AM
This revision was automatically updated to reflect the committed changes.

Thanks!

I am not sure we ever got to the bottom of why deduping this code between projects wasn't working (in other open revisions), but this would certainly help / rule out a few extreme scenarios.