X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/40009f8e8e7678d8e600c77d7e269181ee8a1145..ae2703f5cf2c00470b492092bb6188c38466b5b5:/tools/cmake/GCCFlags.cmake diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 4bc99960be..5883fc786f 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -167,3 +167,12 @@ if(NOT $ENV{LDFLAGS} STREQUAL "") message(STATUS "Add LDFLAGS: \"$ENV{LDFLAGS}\" to CMAKE_C_LINK_FLAGS") set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} $ENV{LDFLAGS}") endif() + +# We don't want to ship libgcc_s_seh-1.dll nor libstdc++-6.dll +#  This will probably be troublesome if someone wants to use the lib in +# its own project, but we only want to have java working on Windows. +if(MINGW) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") + set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic -s") +endif()