From cb7f1a975790dda458481e88de0a29c433b706c9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 20 Jul 2023 12:27:55 +0200 Subject: [PATCH] cmake: try another mac approach Signed-off-by: falkTX --- cmake/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 58cac804d..4a5cca3fc 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.15) -# last compatible macOS version -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Minimum macOS deployment version") -set(CARLA_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) +# adjust for last compatible macOS version +if(APPLE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Minimum macOS deployment version") + set(CARLA_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") +endif() project(carla) @@ -22,10 +26,6 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE) set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) -if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -endif() - ####################################################################################################################### # fix compat with cmake < 3.26