This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Add "install-libcxxabi" target.
ClosedPublic

Authored by EricWF on Jul 31 2015, 10:42 AM.

Details

Summary

Currently you can't install libc++abi from within the LLVM tree without installing all of LLVM. This patch adds an install rule for libc++abi.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 31129.Jul 31 2015, 10:42 AM
EricWF retitled this revision from to [libcxxabi] Add "install-libcxxabi" target..
EricWF updated this object.
EricWF added reviewers: danalbert, rengolin, compnerd.
EricWF added a subscriber: cfe-commits.
rengolin edited edge metadata.Aug 2 2015, 10:04 AM

Looks ok to me, though I'd rather some libc++ folk could approve this one, first.

Does this install the headers too?

martell edited edge metadata.Aug 3 2015, 9:24 AM
martell added subscribers: beanz, martell.

Hi @EricWF,

I added myself and Chris as subscribers to this as it is part of the solution to an issue I brought up in the CMake Roadmap

http://permalink.gmane.org/gmane.comp.compilers.llvm.devel/88899

Many Thanks
Martell

beanz added a comment.Aug 3 2015, 9:46 AM

In general I'd like a more generic solution, but I don't think we have the infrastructure for that yet, so I have no objection to the patches being done like this.

See my comment inline below for the one thing that needs to change.

Thanks,
-Chris

src/CMakeLists.txt
123

You should not specify both ARCHIVE and LIBRARY in the same install command. One of the two will be ignored. As per the documentation (http://www.cmake.org/cmake/help/v3.0/command/install.html).

You will need to do something similar to what is done in AddLLVM.cmake:507-520.

Does this install the headers too?

No. Just the libraries.

Followup on @beanz comments.

src/CMakeLists.txt
123

I don't see where in the documentation that it says you can't use ARCHIVE and LIBRARY in the same install command. Could you be more explicit?

beanz added a comment.Aug 18 2015, 4:55 PM

The signature is:

install(TARGETS targets... [EXPORT <export-name>]
        [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
          PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
         [DESTINATION <dir>]
         [INCLUDES DESTINATION [<dir> ...]]
         [PERMISSIONS permissions...]
         [CONFIGURATIONS [Debug|Release|...]]
         [COMPONENT <component>]
         [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
        ] [...])

The | markers between the argument values mean OR.

You may also note that DESTINATION only shows up once because only one occurrence of it is parsed, and it only accepts one value.

I know that the code you wrote follows a pattern that exists elsewhere in our CMake, I'm just saying it doesn't work, so we shouldn't introduce more occurrences.

What about the extra [ at the beginning of ARCHIVE that spans all the way down to the last line. It seems to me that DESTINATION can be supplied for each library type. There is also an example in the docs that shows using two library types in one install command.

However if your still not confident it will work correctly I will make the change.

@beanz I tested installing both libc++abi.so and libc++abi.a at the same time with different destinations. They both installed into the correct destinations.

beanz accepted this revision.Aug 19 2015, 10:05 AM
beanz added a reviewer: beanz.

You are right, and I apparently don't know how to read documentation...

Patch LGTM as is.

This revision is now accepted and ready to land.Aug 19 2015, 10:05 AM
EricWF closed this revision.Aug 19 2015, 10:18 AM