llvm/cmake/modules
John Brawn f653fb8714 Add auto-exporting of symbols from tools so that plugins work on Windows
The problem with plugins on Windows is that when building a plugin DLL it needs
to explicitly link against something (an exe or DLL) if it uses symbols from
that thing, and that thing must explicitly export those symbols. Also there's a
limit of 65535 symbols that can be exported. This means that currently plugins
only work on Windows when using BUILD_SHARED_LIBS, and that doesn't work with
MSVC.

This patch adds an LLVM_EXPORT_SYMBOLS_FOR_PLUGINS option, which when enabled
automatically exports from all LLVM tools the symbols that a plugin could want
to use so that a plugin can link against a tool directly. Plugins can specify
what tool they link against by using PLUGIN_TOOL argument to llvm_add_library.
The option can also be enabled on Linux, though there all it should do is
restrict the set of symbols that are exported as by default all symbols are
exported.

This option is currently OFF by default, as while I've verified that it works
with MSVC, linux gcc, and cygwin gcc, I haven't tried mingw gcc and I have no
idea what will happen on OSX. Also unfortunately we can't turn on
LLVM_ENABLE_PLUGINS when the option is ON as bugpoint-passes needs to be
loaded by both bugpoint.exe and opt.exe which is incompatible with this
approach. Also currently clang plugins don't work with this approach, which
will be fixed in future patches.

Differential Revision: http://reviews.llvm.org/D18826


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 11:16:43 +00:00
..
AddLLVM.cmake Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
AddLLVMDefinitions.cmake cmake: Avoid leading space in LLVM_DEFINITIONS. 2015-10-12 10:42:03 +00:00
AddOCaml.cmake [cmake] [OCaml] Make ocamldoc targets depend on output files 2015-06-07 19:22:22 +00:00
AddSphinxTarget.cmake Make message about building sphinx documentation with CMake more 2014-08-14 11:57:16 +00:00
CheckAtomic.cmake Repair cmake libatomic check. 2015-06-16 14:00:01 +00:00
CheckCompilerVersion.cmake cmake: include what you use 2016-03-08 18:56:00 +00:00
ChooseMSVCCRT.cmake [CMake] Untabify. 2014-02-02 16:46:35 +00:00
CMakeLists.txt Install cmake files to lib/cmake/llvm 2016-02-04 20:08:19 +00:00
CrossCompile.cmake [CMake] Flag recursive cmake invocations for cross-compile 2015-09-09 14:57:06 +00:00
DetermineGCCCompatible.cmake [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate file 2015-09-29 14:33:58 +00:00
FindOCaml.cmake [OCaml] [cmake] Add CMake buildsystem for OCaml. 2014-12-01 19:50:23 +00:00
FindSphinx.cmake Add SPHINX_WARNINGS_AS_ERRORS CMake option to allow warnings to not be 2014-08-14 11:57:13 +00:00
GenerateVersionFromCVS.cmake Add SVN version to libLLVMLTO 2016-04-16 07:33:14 +00:00
GetHostTriple.cmake Remove autoconf support 2016-01-26 21:29:08 +00:00
GetSVN.cmake cmake: Make SVNVersion.inc work on Windows if svn is called svn.bat. 2014-12-10 00:10:21 +00:00
HandleLLVMOptions.cmake Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
HandleLLVMStdlib.cmake [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate file 2015-09-29 14:33:58 +00:00
LLVM-Config.cmake Avoid linking LLVM component libraries with libLLVM 2016-02-12 01:42:43 +00:00
LLVMConfig.cmake.in Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
LLVMConfigVersion.cmake.in Teach LLVMConfigVersion.cmake to behave as find_package() expects. 2014-04-16 23:15:31 +00:00
LLVMExternalProjectUtils.cmake [CMake] Make llvm_ExternalProject always call the build action 2016-04-08 22:46:04 +00:00
LLVMInstallSymlink.cmake [CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too. 2015-10-16 23:17:13 +00:00
LLVMProcessSources.cmake Teach llvm_add_library() to find include dirs. 2015-02-10 05:04:37 +00:00
TableGen.cmake [CMake] Fixing dependency issue with parallel make when building with LLVM_OPTIMIZED_TABLEGEN. 2015-10-23 19:48:17 +00:00
VersionFromVCS.cmake Add SVN version to libLLVMLTO 2016-04-16 07:33:14 +00:00