diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-03-18 20:09:13 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-03-18 20:09:13 +0000 |
| commit | 3e8c445c9695bde9856ba912841cb3ee4901e607 (patch) | |
| tree | 8a18fd615e5a55758bad1f4796e5469a286d3904 /llvm/cmake | |
| parent | 3d86b235119e4bd90c944228803c2d6fa622f3f8 (diff) | |
| download | bcm5719-llvm-3e8c445c9695bde9856ba912841cb3ee4901e607.tar.gz bcm5719-llvm-3e8c445c9695bde9856ba912841cb3ee4901e607.zip | |
CMake: Disable ENABLE_EXPORTS for executables with MSVC
The MSVC linker won't produce a .lib file for an executable that doesn't
export anything, and LLVM doesn't maintain dllexport annotations or .def
files listing all C++ symbols. It also doesn't support exporting all
symbols, like binutils ld.
CMake 3.2 changed the Ninja generator to list both the .exe and .lib
files as outputs of executable build targets. Ninja would always re-link
executables with ENABLE_EXPORTS because the .lib output file was not
present, and therefore the target was out of date.
llvm-svn: 232662
Diffstat (limited to 'llvm/cmake')
| -rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index de542f54b3a..83897935e27 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -490,6 +490,12 @@ macro(add_llvm_executable name) endif( LLVM_COMMON_DEPENDS ) endmacro(add_llvm_executable name) +function(export_executable_symbols target) + if (NOT MSVC) # MSVC's linker doesn't support exporting all symbols. + set_target_properties(${target} PROPERTIES ENABLE_EXPORTS 1) + endif() +endfunction() + set (LLVM_TOOLCHAIN_TOOLS llvm-ar |

