This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Use `LLVM_COMMON_CMAKE_UTILS` in runtimes just for clarity
ClosedPublic

Authored by Ericson2314 on Jan 1 2022, 10:14 AM.

Details

Reviewers
mstorsjo
ldionne
Group Reviewers
Restricted Project
Restricted Project
Restricted Project
Commits
rG949bbd0a6892: [CMake] Use `LLVM_COMMON_CMAKE_UTILS` in runtimes just for clarity
Summary

In D116472 we created conditionally defined variables for the tools to
unbreak the legacy build where they are in llvm/tools.

The runtimes are not tools, so that flexibility doesn't matter. Still,
it might be nice to define (unconditionally) and use the variable for
the runtimes simply to make the code a bit clearer and document what is
going on.

Also, consistently put project dirs at the beginning, not end of CMAKE_MODULE_PATH. This ensures they will properly shadow similarly named stuff that happens to be later on the path.

Diff Detail

Event Timeline

Ericson2314 created this revision.Jan 1 2022, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 1 2022, 10:14 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Ericson2314 requested review of this revision.Jan 1 2022, 10:14 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptJan 1 2022, 10:14 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a subscriber: Restricted Project. · View Herald Transcript

Looks sensible overall, modulo the typo.

compiler-rt/lib/builtins/CMakeLists.txt
13

Stray }, missing a space?

libcxx/CMakeLists.txt
16

I presume this is fine (even if slightly unrelated) - I see that this aspect is inconsistent between runtimes today. It could be good to mention this in the commit message in any case.

  1. Updating D116477: Use LLVM_COMMON_CMAKE_UTILS in runtimes just for clarity #
  2. Enter a brief description of the changes included in this update.
  3. The first line is used as subject, next lines as comment. #
  4. If you intended to create a new revision, use:
  5. $ arc diff --create

Fix typo

Ericson2314 edited the summary of this revision. (Show Details)Jan 1 2022, 12:15 PM
Ericson2314 marked 2 inline comments as done.
Ericson2314 added inline comments.
compiler-rt/lib/builtins/CMakeLists.txt
13

Oops! Sorry that got through

libcxx/CMakeLists.txt
16

Included now, with motivation.

mstorsjo added inline comments.Jan 1 2022, 12:47 PM
libcxxabi/CMakeLists.txt
20

This has a duplicate /cmake (not present in the other ones). I presume the libcxx precommit CI will tell you that in an hour too...

Other than that, it does seem to build fine in my setup.

mstorsjo added inline comments.Jan 1 2022, 2:01 PM
compiler-rt/CMakeLists.txt
15

This one has CACHE PATH in here while the other ones don't. (And this seems to break the build.)

Ericson2314 updated this revision to Diff 396901.EditedJan 1 2022, 5:51 PM
Ericson2314 marked 2 inline comments as done.

Fix issues

Ericson2314 marked 2 inline comments as done.Jan 1 2022, 5:52 PM
mstorsjo accepted this revision.Jan 2 2022, 2:41 PM

Seems to work fine for me now, but I guess it still requires approval from some of the libcxx approvers.

(It might be nice to add a [CMake] prefix on the commit subject line though.)

Ericson2314 retitled this revision from Use `LLVM_COMMON_CMAKE_UTILS` in runtimes just for clarity to [CMake] Use `LLVM_COMMON_CMAKE_UTILS` in runtimes just for clarity.Jan 2 2022, 4:24 PM
ldionne accepted this revision.Jan 3 2022, 12:43 PM
ldionne added a subscriber: ldionne.

LGTM with a suggestion.

libcxx/CMakeLists.txt
13–16

If you agree, you should also make the change in the other projects.

This revision is now accepted and ready to land.Jan 3 2022, 12:43 PM
Ericson2314 added inline comments.Jan 3 2022, 12:54 PM
libcxx/CMakeLists.txt
13–16

If I did that, I would want to also get the tools which do the similar thing but with the current syle, so I think I will save that for D116524.

This revision was landed with ongoing or failed builds.Jan 3 2022, 12:55 PM
This revision was automatically updated to reflect the committed changes.