This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add site config option for ABI macros
ClosedPublic

Authored by smeenai on Aug 14 2017, 4:03 PM.

Details

Summary

Some ABI macros affect headers, so it's nice to have a site config
option for them. Add a LIBCXX_ABI_DEFINES cmake macro to allow
specifying a list of ABI macros to define in the site config.

The primary design constraint (as discussed with Eric on IRC a while
back) was to not have to repeat the ABI macro names in cmake, which only
leaves a free-form cmake list as an option. A somewhat unfortunate
consequence is that we can't verify that the ABI macros being defined
actually exist, though we can at least perform some basic sanity
checking, since all the ABI macros begin with _LIBCPP_ABI_.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Aug 14 2017, 4:03 PM

There should probably be some documentation for this, but I couldn't think of the right place; the Using libc++ documentation only mentions the actual configuration macros, not their corresponding cmake defines. Any suggestions?

EricWF accepted this revision.Sep 12 2017, 5:44 PM

There should probably be some documentation for this, but I couldn't think of the right place; the Using libc++ documentation only mentions the actual configuration macros, not their corresponding cmake defines. Any suggestions?

docs/BuildingLibcxx.rst under "libc++ ABI Feature Options".

LGTM after adding documentation, and addressing the inline comment.

CMakeLists.txt
610 ↗(On Diff #111090)

Should LIBCXX_ABI_DEFINES be a cache variable that has documentation? ex:

set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header")
This revision is now accepted and ready to land.Sep 12 2017, 5:44 PM
smeenai updated this revision to Diff 117757.Oct 4 2017, 4:08 PM

Address comments

This revision was automatically updated to reflect the committed changes.