From 7298741ad4d0fb3804823856568e9f2c086e0a0b Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Thu, 16 Jun 2022 20:56:14 +0200 Subject: [PATCH] Initialize ObjC to skip m/mm files in Unity builds It should also initialize proper parameters used to compile ObjC(++) files Signed-off-by: Alexander Borsuk --- CMakeLists.txt | 8 +++++++- platform/CMakeLists.txt | 9 --------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3b225ddcd..acffad785a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,12 @@ cmake_minimum_required(VERSION 3.18) -project(omim C CXX) +set(LANGUAGES C CXX) +if (APPLE) + # OBJC/OBJCXX are needed to skip m/mm files in Unity builds. + # https://gitlab.kitware.com/cmake/cmake/-/issues/21963 + list(APPEND LANGUAGES OBJC OBJCXX) +endif() +project(omim ${LANGUAGES}) set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_STANDARD 11) diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt index 063df2873f..b724e2cafb 100644 --- a/platform/CMakeLists.txt +++ b/platform/CMakeLists.txt @@ -159,16 +159,7 @@ omim_add_test_subdirectory(platform_tests) set_property( SOURCE preferred_languages.cpp - apple_location_service.mm - gui_thread_apple.mm - http_client_apple.mm - http_thread_apple.mm - http_uploader_apple.mm http_uploader_background_dummy.cpp - locale.mm - platform_mac.mm - socket_apple.mm - http_session_manager.mm PROPERTY SKIP_UNITY_BUILD_INCLUSION ON )