From dc6d1481d76d6d338ab5de36cf81707a686abbcf Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 1 Oct 2015 21:41:32 +0200 Subject: [PATCH] [windows] request mingw-gcc to put the content of libgcc_s_seh-1.dll statically in our libs --- tools/cmake/GCCFlags.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 4bc99960be..6b41adf478 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -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() -- 2.20.1