Do export symbols when LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is on.
authorSimon Tatham <simon.tatham@arm.com>
Thu, 26 Mar 2020 09:06:59 +0000 (09:06 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Thu, 26 Mar 2020 09:07:02 +0000 (09:07 +0000)
commit6a946993d519a395e45e0af4a730c521b94e7dfb
treeff106cd32ae706c1f0b64b44be8f35288130ceeb
parent37b9cc8f29e993ba9894402dd87f9c4be83cb8f6
Do export symbols when LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is on.

Summary:
In D76527, we stopped exporting symbols from clang, opt and llc unless
the `LLVM_ENABLE_PLUGINS` cmake variable is true (which causes clang's
own plugin collection to be built).

But another reasonable build configuration is to ask clang to export
its symbols for out-of-tree plugins to use, without building the
in-tree ones. That is, you might set `LLVM_EXPORT_SYMBOLS_FOR_PLUGINS`
without also setting `LLVM_ENABLE_PLUGINS` (at least if you're using
MSVC, where you need to ask explicitly for the symbols to be
exported).

In that situation, the symbols should still be exported, but after
D76527, they weren't being.

Reviewers: efriedma, john.brawn

Reviewed By: efriedma, john.brawn

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76760
llvm/cmake/modules/AddLLVM.cmake