CMake: Set wxBUILD_CXX_STANDARD globally instead of only on targets

This way the tests in setup.cmake will use the correct c++ version.
This commit is contained in:
Maarten Bent
2020-04-06 23:10:06 +02:00
parent fab2d067b5
commit c8209a5111
2 changed files with 4 additions and 2 deletions

View File

@@ -78,8 +78,6 @@ function(wx_set_common_target_properties target_name)
cmake_parse_arguments(wxCOMMON_TARGET_PROPS "DEFAULT_WARNINGS" "" "" ${ARGN})
if(DEFINED wxBUILD_CXX_STANDARD AND NOT wxBUILD_CXX_STANDARD STREQUAL COMPILER_DEFAULT)
# TODO: implement for older CMake versions ?
set_target_properties(${target_name} PROPERTIES CXX_STANDARD ${wxBUILD_CXX_STANDARD})
if(
APPLE AND
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9 AND

View File

@@ -8,6 +8,10 @@
# Licence: wxWindows licence
#############################################################################
if(DEFINED wxBUILD_CXX_STANDARD AND NOT wxBUILD_CXX_STANDARD STREQUAL COMPILER_DEFAULT)
set(CMAKE_CXX_STANDARD ${wxBUILD_CXX_STANDARD})
endif()
if(MSVC)
# Determine MSVC runtime library flag
set(MSVC_LIB_USE "/MD")