Skip to content
Snippets Groups Projects
Commit a6bc1c34 authored by Brad King's avatar Brad King
Browse files

ENH: Auto-import symbols for cygwin executables

This enables the --enable-auto-import linker flag on Cygwin when linking
executables.  It works with the old gcc 3.x compiler and is necessary
for the new gcc 4.x compiler.  See issue #9071.
parent bd1e91a4
No related branches found
No related tags found
No related merge requests found
SET(WIN32 1)
SET(CYGWIN 1)
SET(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--enable-auto-import")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
SET(CMAKE_DL_LIBS "-lgdi32" )
......
......@@ -55,6 +55,13 @@ cmake_bootstrap_system_libs=""
cmake_bootstrap_qt_gui=""
cmake_bootstrap_qt_qmake=""
# Determine whether this is a Cygwin environment.
if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
cmake_system_cygwin=true
else
cmake_system_cygwin=false
fi
# Determine whether this is a MinGW environment.
if echo "${cmake_system}" | grep MINGW >/dev/null 2>&1; then
cmake_system_mingw=true
......@@ -598,6 +605,11 @@ cmake_c_flags=${CFLAGS}
cmake_cxx_flags=${CXXFLAGS}
cmake_ld_flags=${LDFLAGS}
# Add Cygwin-specific flags
if ${cmake_system_cygwin}; then
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
fi
# Add Carbon framework on Darwin
if ${cmake_system_darwin}; then
cmake_ld_flags="${LDFLAGS} -framework Carbon"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment