From affc079de8a31fad812f42117aa3e7befaedf6fd Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Fri, 2 Feb 2018 17:15:23 +0300 Subject: [PATCH] [platform-build] Disabled swift/multipart upload for cmake build. --- platform/CMakeLists.txt | 8 +++++++- platform/http_uploader_apple.mm | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt index 4383357720..f616bceaef 100644 --- a/platform/CMakeLists.txt +++ b/platform/CMakeLists.txt @@ -105,6 +105,7 @@ else() # neither iPhone nor Android http_thread_apple.h http_thread_apple.mm http_uploader_apple.mm + http_uploader_apple.swift marketing_service_dummy.cpp platform_mac.mm platform_unix_impl.cpp @@ -133,8 +134,13 @@ add_subdirectory(platform_tests_support) add_library(${PROJECT_NAME} ${SRC}) +# 2 next lines are added for future support of swift code compilation. +set(SWIFT_BRIDGING_HEADER platform-Swift.h) +set_property(TARGET ${PROJECT_NAME} PROPERTY XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "${SWIFT_BRIDGING_HEADER}") + if (APPLE) - target_compile_options(${PROJECT_NAME} PUBLIC "-fobjc-arc") +# "-DIGNORE_SWIFT=1" key is added as the temporary solution until support of swift code compilation. + target_compile_options(${PROJECT_NAME} PUBLIC "-fobjc-arc" "-DIGNORE_SWIFT=1") endif() omim_add_test_subdirectory(platform_tests) diff --git a/platform/http_uploader_apple.mm b/platform/http_uploader_apple.mm index 53801cfdb8..20e4cbd416 100644 --- a/platform/http_uploader_apple.mm +++ b/platform/http_uploader_apple.mm @@ -1,5 +1,7 @@ #import +#ifndef IGNORE_SWIFT // Temporary solution for CMAKE builds. TODO: Remove when support of swift code compilation is added. #import "platform-Swift.h" +#endif #include "platform/http_uploader.hpp" @@ -17,6 +19,7 @@ namespace platform { HttpUploader::Result HttpUploader::Upload() const { +#ifndef IGNORE_SWIFT // Temporary solution for CMAKE builds. TODO: Remove when support of swift code compilation is added. std::shared_ptr resultPtr = std::make_shared(); std::shared_ptr waiterPtr = std::make_shared(); @@ -43,7 +46,7 @@ HttpUploader::Result HttpUploader::Upload() const if (waiterPtr->Wait(kTimeout) == base::Waiter::Result::NoTimeout) return *resultPtr; - +#endif return {}; } } // namespace platform