This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add _LIBCPP_DISABLE_EXTERN_TEMPLATE config option
ClosedPublic

Authored by smeenai on Apr 5 2017, 2:07 PM.

Details

Summary

When the libc++ extern template macros were added, the intent was for it
to be possible for consumers of the headers to disable extern templates
(via -D_LIBCPP_EXTERN_TEMPLATE(...)=). Unfortunately, support for
specifying function-like macros varies on the command line varies across
compilers (e.g. MSVC doesn't support it at all), and cmake doesn't allow
it for the same reason. Add a non-function macro for this purpose.

The intended use is for libraries which want to use the libc++ headers
without taking a dependency on the libc++ library itself. I can name the
macro something which reflects its intent rather than its behavior (e.g.
_LIBCPP_HEADER_ONLY) if desired.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Apr 5 2017, 2:07 PM
EricWF accepted this revision.Apr 12 2017, 11:36 PM

LGTM minus doc.

This revision is now accepted and ready to land.Apr 12 2017, 11:36 PM
smeenai updated this revision to Diff 95189.Apr 13 2017, 1:24 PM

Add documentation

This revision was automatically updated to reflect the committed changes.