mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232662 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user