aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2019-06-11 18:46:38 +0200
committerGitHub <noreply@github.com>2019-06-11 18:46:38 +0200
commitaac8f213b589d782f87e235a735de197f4a83384 (patch)
tree971fcce48995969812ad551204140f769f6a19d0 /templates
parentcc0653207ac681cbfe645d9f22415a409eed47f9 (diff)
parenta5090c5875af64b2ebe1883604c31ee1d4040463 (diff)
downloadgrpc-grpc-aac8f213b589d782f87e235a735de197f4a83384.tar.gz
Merge pull request #19302 from dronecore/add-cmake-system-name-ios
Add support for CMAKE_SYSTEM_NAME=iOS
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template6
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 4057da40c1..43bc063aee 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -130,6 +130,8 @@
set(_gRPC_PLATFORM_LINUX ON)
elseif(<%text>${CMAKE_SYSTEM_NAME}</%text> MATCHES "Darwin")
set(_gRPC_PLATFORM_MAC ON)
+ elseif(<%text>${CMAKE_SYSTEM_NAME}</%text> MATCHES "iOS")
+ set(_gRPC_PLATFORM_IOS ON)
elseif(<%text>${CMAKE_SYSTEM_NAME}</%text> MATCHES "Android")
set(_gRPC_PLATFORM_ANDROID ON)
else()
@@ -173,7 +175,7 @@
endif()
endif()
- if (_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC)
+ if (_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS)
# C core has C++ source code, but should not depend on libstc++ (for better portability).
# We need to use a few tricks to convince cmake to do that.
# https://stackoverflow.com/questions/15058403/how-to-stop-cmake-from-linking-against-libstdc
@@ -198,7 +200,7 @@
set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS}</%text> -std=c++11")
endif()
- if(_gRPC_PLATFORM_MAC)
+ if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS)
set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> m pthread)
elseif(_gRPC_PLATFORM_ANDROID)
set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> m)