From f3e238073babb1c3a449bd18d64a5c4500414490 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Thu, 13 Dec 2018 18:51:08 +0100 Subject: [PATCH] Mac OS build: Set a default SDK target, fix c/cxx flags in deps/boost --- CMakeLists.txt | 7 +++++++ deps/deps-macos.cmake | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44b77de48..625ebb334 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,13 @@ if(WIN32) endif() endif() +if (APPLE) + if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "OS X Deployment target (SDK version)" FORCE) + endif () + message(STATUS "Mac OS deployment target (SDK version): ${CMAKE_OSX_DEPLOYMENT_TARGET}") +endif () + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") # Workaround for an old CMake, which does not understand CMAKE_CXX_STANDARD. add_compile_options(-std=c++11 -Wall -Wno-reorder) diff --git a/deps/deps-macos.cmake b/deps/deps-macos.cmake index 10c15dace..720ec50d0 100644 --- a/deps/deps-macos.cmake +++ b/deps/deps-macos.cmake @@ -23,8 +23,8 @@ ExternalProject_Add(dep_boost variant=release threading=multi boost.locale.icu=off - "cflags=cflags=-fPIC -mmacosx-version-min=${DEPS_OSX_TARGET}" - "cxxflags=cxxflags=-fPIC -mmacosx-version-min=${DEPS_OSX_TARGET}" + "cflags=-fPIC -mmacosx-version-min=${DEPS_OSX_TARGET}" + "cxxflags=-fPIC -mmacosx-version-min=${DEPS_OSX_TARGET}" install INSTALL_COMMAND "" # b2 does that already )