summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-01-21 15:03:32 -0500
committerBrad King <brad.king@kitware.com>2010-01-21 15:03:32 -0500
commit3684f62340d026c4fcc31b04af2685c7092a27e2 (patch)
treef7c04c985883b11f2d4a04f4f0aa080b24abc7f0 /Modules
parent41024b006bcfcb0222b10fa08af2d75153511d18 (diff)
downloadcmake-3684f62340d026c4fcc31b04af2685c7092a27e2.tar.gz
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.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 993de69f32..6a80f62d40 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()