diff options
author | Brad King <brad.king@kitware.com> | 2010-01-21 20:03:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-01-21 20:03:32 (GMT) |
commit | 3684f62340d026c4fcc31b04af2685c7092a27e2 (patch) | |
tree | f7c04c985883b11f2d4a04f4f0aa080b24abc7f0 /Modules | |
parent | 41024b006bcfcb0222b10fa08af2d75153511d18 (diff) | |
download | CMake-3684f62340d026c4fcc31b04af2685c7092a27e2.zip CMake-3684f62340d026c4fcc31b04af2685c7092a27e2.tar.gz CMake-3684f62340d026c4fcc31b04af2685c7092a27e2.tar.bz2 |
Do not export all symbols from DLLs on Cygwin
In commit "use export all symbols on cygwin" (2003-01-21) we started
passing -Wl,--export-all-symbols when linking shared libraries. Now
cygwin exports all symbols automatically if no symbols are explicitly
exported. When symbols are explicitly exported we want to honor that
narrow interface. Therefore this flag should not be passed.
Change based on patch from issue #10122.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/CYGWIN-GNU.cmake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 993de69..6a80f62 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -18,6 +18,7 @@ if(__CYGWIN_COMPILER_GNU) endif() set(__CYGWIN_COMPILER_GNU 1) +# TODO: Is -Wl,--enable-auto-import now always default? set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--enable-auto-import") set(CMAKE_CREATE_WIN32_EXE "-mwindows") @@ -44,7 +45,7 @@ macro(__cygwin_compiler_gnu lang) SET(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic") ENDFOREACH(type) - # To simulate UNIX shared libs we export/import all DLL symbols. - set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--export-all-symbols -Wl,--enable-auto-import") + # TODO: Is -Wl,--enable-auto-import now always default? + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--enable-auto-import") set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}") endmacro() |