CMake: MinGW multiple definition issue has been fixed (wxBUILD_USE_STATIC_RUNTIME)

This commit is contained in:
Deamhan 2019-07-10 11:30:31 +03:00
parent afcec3eefc
commit e0ad857a2d

View File

@ -43,7 +43,11 @@ if(MSVC)
endif()
elseif(CMAKE_COMPILER_IS_GNUCC)
if(wxBUILD_USE_STATIC_RUNTIME)
set(STATIC_LINKER_FLAGS " -static-libgcc -static-libstdc++")
if(MINGW)
set(STATIC_LINKER_FLAGS " -static -Wl,--allow-multiple-definition")
else()
set(STATIC_LINKER_FLAGS " -static-libgcc -static-libstdc++")
endif()
wx_string_append(CMAKE_EXE_LINKER_FLAGS "${STATIC_LINKER_FLAGS}")
wx_string_append(CMAKE_SHARED_LINKER_FLAGS "${STATIC_LINKER_FLAGS}")
endif()