From 6a946993d519a395e45e0af4a730c521b94e7dfb Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 26 Mar 2020 09:06:59 +0000 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 8cd71ee..238aa3e 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1031,7 +1031,7 @@ endfunction() # Export symbols if LLVM plugins are enabled. function(export_executable_symbols_for_plugins target) - if(LLVM_ENABLE_PLUGINS) + if(LLVM_ENABLE_PLUGINS OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS) export_executable_symbols(${target}) endif() endfunction() -- 2.7.4