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:
@@ -36,12 +36,22 @@ if(MSVC)
|
|||||||
"Flags used by the CXX compiler during ${cfg_upper} builds." FORCE)
|
"Flags used by the CXX compiler during ${cfg_upper} builds." FORCE)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(wxBUILD_MSVC_MULTIPROC)
|
if(wxBUILD_MSVC_MULTIPROC)
|
||||||
wx_string_append(CMAKE_C_FLAGS " /MP")
|
wx_string_append(CMAKE_C_FLAGS " /MP")
|
||||||
wx_string_append(CMAKE_CXX_FLAGS " /MP")
|
wx_string_append(CMAKE_CXX_FLAGS " /MP")
|
||||||
endif()
|
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)
|
if(wxBUILD_COMPATIBILITY VERSION_LESS 3.0)
|
||||||
set(WXWIN_COMPATIBILITY_2_8 ON)
|
set(WXWIN_COMPATIBILITY_2_8 ON)
|
||||||
|
@@ -26,8 +26,11 @@ mark_as_advanced(wxBUILD_CUSTOM_SETUP_HEADER_PATH)
|
|||||||
wx_option(wxBUILD_DEBUG_LEVEL "Debug Level" Default STRINGS Default 0 1 2)
|
wx_option(wxBUILD_DEBUG_LEVEL "Debug Level" Default STRINGS Default 0 1 2)
|
||||||
mark_as_advanced(wxBUILD_DEBUG_LEVEL)
|
mark_as_advanced(wxBUILD_DEBUG_LEVEL)
|
||||||
|
|
||||||
if(MSVC)
|
if(NOT APPLE)
|
||||||
wx_option(wxBUILD_USE_STATIC_RUNTIME "Link using the static runtime library" OFF)
|
wx_option(wxBUILD_USE_STATIC_RUNTIME "Link using the static runtime library" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
wx_option(wxBUILD_MSVC_MULTIPROC "Enable multi-processor compilation for MSVC")
|
wx_option(wxBUILD_MSVC_MULTIPROC "Enable multi-processor compilation for MSVC")
|
||||||
else()
|
else()
|
||||||
# Other compilers support setting the C++ standard, present it an option to the user
|
# Other compilers support setting the C++ standard, present it an option to the user
|
||||||
@@ -58,7 +61,9 @@ if(NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support")
|
wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support")
|
||||||
|
if(NOT WIN32)
|
||||||
wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility")
|
wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility")
|
||||||
|
endif()
|
||||||
wx_option(wxUSE_UNSAFE_WXSTRING_CONV "provide unsafe implicit conversions in wxString to const char* or std::string")
|
wx_option(wxUSE_UNSAFE_WXSTRING_CONV "provide unsafe implicit conversions in wxString to const char* or std::string")
|
||||||
wx_option(wxUSE_REPRODUCIBLE_BUILD "enable reproducable build" OFF)
|
wx_option(wxUSE_REPRODUCIBLE_BUILD "enable reproducable build" OFF)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user