diff --git a/CMakeLists.txt b/CMakeLists.txt index a067b00356..21ae14c342 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,12 @@ endif() if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET) # If no deployment target has been set default to the minimum supported # OS X version (this has to be set before the first project() call) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "OS X Deployment Target") + if(CMAKE_CXX_STANDARD EQUAL 11 OR CMAKE_CXX_STANDARD EQUAL 14) + set(OSX_DEFAULT_DEPLOYMENT_TARGET 10.9) + else() + set(OSX_DEFAULT_DEPLOYMENT_TARGET 10.7) + endif() + set(CMAKE_OSX_DEPLOYMENT_TARGET ${OSX_DEFAULT_DEPLOYMENT_TARGET} CACHE STRING "OS X Deployment Target") endif() project(wxWidgets) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 23c68ee76d..6cf1faf00d 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -74,7 +74,13 @@ function(wx_set_common_target_properties target_name) # TODO: implement for older CMake versions ? set_target_properties(${target_name} PROPERTIES CXX_STANDARD ${wxBUILD_CXX_STANDARD}) if(wxBUILD_CXX_STANDARD EQUAL 11 OR wxBUILD_CXX_STANDARD EQUAL 14) - set_target_properties(${target_name} PROPERTIES XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY libc++) + if (APPLE) + if(CMAKE_GENERATOR EQUAL "Xcode") + set_target_properties(${target_name} PROPERTIES XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY libc++) + else() + target_compile_options(${target_name} PUBLIC "-stdlib=libc++") + endif() + endif() #TODO: define for other generators than Xcode endif() endif() @@ -304,7 +310,7 @@ endfunction() # Enable cotire for target if precompiled headers are enabled macro(wx_target_enable_precomp target_name) if(wxBUILD_PRECOMP) - if(CMAKE_GENERATOR STREQUAL "Xcode" AND ${target_name} STREQUAL "wxscintilla") + if(APPLE AND ${target_name} STREQUAL "wxscintilla") # TODO: workaround/fix cotire issue with wxscintilla when using Xcode else() set_target_properties(${target_name} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)