Skip to content
Snippets Groups Projects
Commit 0c38f3df authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

try really hard to use static system libs on cygwin/mingw

parent 03141287
No related branches found
No related tags found
No related merge requests found
...@@ -675,8 +675,6 @@ if(ENABLE_OCC) ...@@ -675,8 +675,6 @@ if(ENABLE_OCC)
# unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4 # unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
endforeach(OCC) endforeach(OCC)
list(LENGTH OCC_LIBS NUM_OCC_LIBS) list(LENGTH OCC_LIBS NUM_OCC_LIBS)
if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED) if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
include opencascade) include opencascade)
...@@ -773,9 +771,9 @@ endif(MSVC) ...@@ -773,9 +771,9 @@ endif(MSVC)
if(WIN32 AND NOT HAVE_FLTK) if(WIN32 AND NOT HAVE_FLTK)
if(MSVC) if(MSVC)
list(APPEND EXTERNAL_LIBRARIES "wsock32.lib") list(APPEND EXTERNAL_LIBRARIES "wsock32.lib")
ELSE(MSVC) ELSE(MSVC)
list(APPEND EXTERNAL_LIBRARIES "ws2_32.lib wsock32.lib") list(APPEND EXTERNAL_LIBRARIES "ws2_32.lib wsock32.lib")
ENDIF(MSVC) ENDIF(MSVC)
endif(WIN32 AND NOT HAVE_FLTK) endif(WIN32 AND NOT HAVE_FLTK)
...@@ -886,10 +884,15 @@ add_executable(gmsh_dynamic EXCLUDE_FROM_ALL Fltk/Main.cpp) ...@@ -886,10 +884,15 @@ add_executable(gmsh_dynamic EXCLUDE_FROM_ALL Fltk/Main.cpp)
target_link_libraries(gmsh_dynamic shared) target_link_libraries(gmsh_dynamic shared)
# increase stack to 16Mb on Windows to avoid overflows in recursive # increase stack to 16Mb on Windows to avoid overflows in recursive
# tet classification for large 3D Delaunay grids # tet classification for large 3D Delaunay grids + force static
# linking of system libraries with cygwin/mingw (to ease distribution
# andspeed up app startup time)
if(WIN32 AND NOT MSVC) if(WIN32 AND NOT MSVC)
set_target_properties(gmsh PROPERTIES LINK_FLAGS set_target_properties(gmsh PROPERTIES LINK_FLAGS
"-Wl,--stack,16777216 ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res -mwindows") "-Wl,--stack,16777216 ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res -mwindows -static")
# remove stupid -Wl,-Bdynamic flags
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
elseif(MSVC) elseif(MSVC)
set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216") set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216")
endif(WIN32 AND NOT MSVC) endif(WIN32 AND NOT MSVC)
......
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