From 3684f62340d026c4fcc31b04af2685c7092a27e2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 21 Jan 2010 15:03:32 -0500 Subject: 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. --- Modules/Platform/CYGWIN-GNU.cmake | 5 +++-- 1 file 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() -- cgit v0.12