diff --git a/.gitignore b/.gitignore index aecf49e324..76f74b96fe 100644 --- a/.gitignore +++ b/.gitignore @@ -240,6 +240,8 @@ /lib/wxmsw*.ilk /lib/wxmsw*.lib /lib/zlib*.lib +/lib/wxWidgetsConfig.cmake +/lib/wxWidgetsConfigVersion.cmake # /locale/ /locale/*.mo diff --git a/CMakeLists.txt b/CMakeLists.txt index 9af67b4dc8..0be5777afb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,14 @@ if(NOT CMAKE_CONFIGURATION_TYPES) endif() endif() +if(MSVC) + add_compile_options( + $<$:/MT> #---------| + $<$:/MTd> #---|-- Statically link the runtime libraries + $<$:/MT> #--| + ) +endif() + file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX) # https://blog.kitware.com/cmake-and-the-default-build-type/ diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 5d88a7e487..c337483518 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -95,10 +95,10 @@ elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID} endif() if(wxBUILD_COMPATIBILITY VERSION_LESS 3.0) - set(WXWIN_COMPATIBILITY_2_8 ON) + set(WXWIN_COMPATIBILITY_2_8 OFF) endif() if(wxBUILD_COMPATIBILITY VERSION_LESS 3.1) - set(WXWIN_COMPATIBILITY_3_0 ON) + set(WXWIN_COMPATIBILITY_3_0 OFF) endif() # Build wxBUILD_FILE_ID used for config and setup path diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 28f3fa461c..6a5fbeb989 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -20,7 +20,7 @@ wx_option(wxBUILD_PRECOMP "Use precompiled headers" ON STRINGS ON OFF COTIRE) mark_as_advanced(wxBUILD_PRECOMP) wx_option(wxBUILD_INSTALL "Create install/uninstall target for wxWidgets") wx_option(wxBUILD_COMPATIBILITY - "enable compatibilty with earlier wxWidgets versions" 3.0 STRINGS 2.8 3.0 3.1) + "enable compatibilty with earlier wxWidgets versions" 3.2 STRINGS 2.8 3.0 3.1 3.2) mark_as_advanced(wxBUILD_COMPATIBILITY) # Allow user specified setup.h folder set(wxBUILD_CUSTOM_SETUP_HEADER_PATH "" CACHE PATH "Include path containing custom wx/setup.h") @@ -83,7 +83,7 @@ wx_option(wxUSE_NO_RTTI "disable RTTI support" OFF) # STL options wx_option(wxUSE_STL "use standard C++ classes for everything" OFF) set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_STL "use C++ STL classes") -wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON "wxUSE_STL" OFF) +wx_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON) wx_option(wxUSE_UNICODE "compile with Unicode support (NOT RECOMMENDED to be turned off)") if(NOT WIN32) @@ -91,7 +91,7 @@ if(NOT WIN32) wx_dependent_option(wxUSE_UTF8_LOCALE_ONLY "only support UTF-8 locales in UTF-8 build (Unix only)" ON "wxUSE_UNICODE_UTF8" OFF) endif() -wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support") +wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support" 2) if(NOT WIN32) wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility") endif() diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index fcc282980d..36cb058fe3 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -136,7 +136,7 @@ #cmakedefine01 wxDIALOG_UNIT_COMPATIBILITY -#cmakedefine01 wxUSE_UNSAFE_WXSTRING_CONV +#define wxUSE_UNSAFE_WXSTRING_CONV 1 #cmakedefine01 wxUSE_REPRODUCIBLE_BUILD @@ -185,7 +185,7 @@ #cmakedefine01 wxUSE_PRINTF_POS_PARAMS -#cmakedefine01 wxUSE_COMPILER_TLS +#define wxUSE_COMPILER_TLS 2 #cmakedefine01 wxUSE_STL @@ -194,13 +194,13 @@ #define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT -#cmakedefine01 wxUSE_STD_CONTAINERS +#define wxUSE_STD_CONTAINERS 1 #define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT #define wxUSE_STD_STRING wxUSE_STD_DEFAULT -#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL +#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1 #cmakedefine01 wxUSE_LONGLONG @@ -240,7 +240,7 @@ #cmakedefine01 wxUSE_CONFIG_NATIVE -#cmakedefine01 wxUSE_DIALUP_MANAGER +#define wxUSE_DIALUP_MANAGER 0 #cmakedefine01 wxUSE_DYNLIB_CLASS diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 6fdcd93906..f34e3b2630 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -40,7 +40,7 @@ // in the version after it completely. // // Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_3_0 1 +#define WXWIN_COMPATIBILITY_3_0 0 // MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when // default system font is used for wxWindow::GetCharWidth/Height() instead of @@ -299,7 +299,7 @@ // // Recommended setting: 2 if you want to have maximal performance and don't // care about the scenario described above. -#define wxUSE_COMPILER_TLS 1 +#define wxUSE_COMPILER_TLS 2 // ---------------------------------------------------------------------------- // Interoperability with the standard library.