Merge branch 'cmake-gcc-static' of https://github.com/Deamhan/wxWidgets

Add support for using static CRT libraries with gcc to CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/1398
This commit is contained in:
Vadim Zeitlin
2019-07-16 18:25:52 +02:00
2 changed files with 21 additions and 6 deletions

View File

@@ -36,11 +36,21 @@ if(MSVC)
"Flags used by the CXX compiler during ${cfg_upper} builds." FORCE)
endif()
endforeach()
endif()
if(wxBUILD_MSVC_MULTIPROC)
wx_string_append(CMAKE_C_FLAGS " /MP")
wx_string_append(CMAKE_CXX_FLAGS " /MP")
if(wxBUILD_MSVC_MULTIPROC)
wx_string_append(CMAKE_C_FLAGS " /MP")
wx_string_append(CMAKE_CXX_FLAGS " /MP")
endif()
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
if(wxBUILD_USE_STATIC_RUNTIME)
if(MINGW)
set(STATIC_LINKER_FLAGS " -static")
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()
endif()
if(wxBUILD_COMPATIBILITY VERSION_LESS 3.0)