Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "[windows] also take the static version of libpthread.dll"
[simgrid.git] / tools / cmake / GCCFlags.cmake
index 4bc9996..6b41adf 100644 (file)
@@ -167,3 +167,13 @@ 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_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s")
+  set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s")
+endif()