This is an archive of the discontinued LLVM Phabricator instance.

build: use multiple `install` rather than building up a list
ClosedPublic

Authored by compnerd on Jul 8 2019, 6:10 PM.

Details

Summary

Rather than building up a list to iterate over later, just create multiple install commands based on the configuration. This makes it easier to see what is getting installed and allows for the install handling to be centralised. NFC

Diff Detail

Repository
rCXX libc++

Event Timeline

compnerd created this revision.Jul 8 2019, 6:10 PM

I like that. Almost anything that helps us abolish global variables and lists (here LIBCXX_INSTALL_TARGETS) in the CMake scripts is a good thing.

src/CMakeLists.txt
441

Just to double-check, it's redundant to say ARCHIVE here because CMake knows it's a static archive -- correct?

compnerd marked an inline comment as done.Jul 9 2019, 8:00 AM

@ldionne - that was exactly the motivation for this change - it always takes me a couple of reads to figure out what we are trying to do here.

src/CMakeLists.txt
441

No, the ARCHIVE DESTINATION here indicates to CMake where to install the target *if* it is an archive. This is the location used if the target is a static library or if the target is Windows and the target is a shared library in which case this is the path where the import library is installed.

ldionne accepted this revision.Jul 9 2019, 12:17 PM
This revision is now accepted and ready to land.Jul 9 2019, 12:17 PM
smeenai accepted this revision.Jul 9 2019, 12:20 PM

Nice!

src/CMakeLists.txt
440

Super nit: you don't have a newline here but do have a newline before the LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY conditional. (I don't have a preference for newline vs. no newline; the inconsistency is just mildly noticeable).

compnerd closed this revision.Jul 9 2019, 2:42 PM

SVN r365562