This is an archive of the discontinued LLVM Phabricator instance.

[clang][cmake] Rearrange top-level CMakeLists.txt for D116492
ClosedPublic

Authored by Ericson2314 on Jan 3 2022, 10:22 AM.

Details

Summary

In that revision, I make LLD match Clang in deprecating llvm-config.
This patch isn't to worthwhile on its own --- there isn't a sense in
which the new order is "better" in isolation --- but by putting the
steps that LLD also neeeds to do first, I make the diff between LLD and
Clang's top-level CMakeLists.txt very legible.

Longer term I hope:

  1. We can remove calling llvm-config altogether, and just go strait to finding the CMake config file. This is what Flang does, at least.
  2. Hopefully the diffable part is smaller then --- i.e. there is less duplicated boilerplate.
  3. Any duplicate boilerplate that remains can be factored out.

I didn't both trying to factor anything out in e.g. the top level common
CMake Utility modules because this deprecated-but-not-removed state is a
merely transitional.

Diff Detail

Event Timeline

Ericson2314 created this revision.Jan 3 2022, 10:22 AM
Ericson2314 requested review of this revision.Jan 3 2022, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2022, 10:22 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
beanz accepted this revision.Jan 3 2022, 10:26 AM

LGTM

This revision is now accepted and ready to land.Jan 3 2022, 10:26 AM
This revision was landed with ongoing or failed builds.Jan 3 2022, 10:28 AM
This revision was automatically updated to reflect the committed changes.

(Note to posterity: I didn't wait for the build to finish because the last night's D116492 build already demonstrated this diff did not break things.)