diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5d9a6f8..c199ddfd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,7 +239,7 @@ if(APPLE) add_definitions(-D_DARWIN_C_SOURCE) list(APPEND OS_LIB "-framework Foundation") if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS "10.0") # Darwin 10.x is Mac OS X 10.6 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") endif() # Not supported until Xcode 9 if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "9") @@ -761,6 +761,7 @@ if(USE_ELF) endif() if (USE_DISCORD_RPC) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/discord-rpc discord-rpc EXCLUDE_FROM_ALL) list(APPEND FEATURES DISCORD_RPC) include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/discord-rpc/include) diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index 5a56f775d..9feb9dc0b 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -58,8 +58,7 @@ if(APPLE) else() set(MIN_VER 10.8) endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${MIN_VER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${MIN_VER}") + set(CMAKE_OSX_DEPLOYMENT_TARGET ${MIN_VER}) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() diff --git a/src/platform/sdl/CMakeLists.txt b/src/platform/sdl/CMakeLists.txt index 987bd160f..2bc7c49eb 100644 --- a/src/platform/sdl/CMakeLists.txt +++ b/src/platform/sdl/CMakeLists.txt @@ -23,7 +23,7 @@ if (SDL_VERSION EQUAL "2") endif() if(APPLE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7") endif() set(SDLMAIN_LIBRARY ${SDL2MAIN_LIBRARY}) endif()