summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
blob: 5177ec2c84e8deb783f2cf0d2c0d16aa12f7ec18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cmake_minimum_required(VERSION 3.3)

project(XcodeIOSInstallCombinedSingleArch CXX)

set(iphoneos_arch armv7)
if(XCODE_VERSION VERSION_GREATER_EQUAL 14)
  set(CMAKE_OSX_DEPLOYMENT_TARGET 16)
  set(iphoneos_arch arm64)
elseif(XCODE_VERSION VERSION_GREATER_EQUAL 9)
  set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
endif()

set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")

add_library(foo SHARED foo.cpp)
install(TARGETS foo DESTINATION lib)

set_target_properties(
  foo
  PROPERTIES
  XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] ${iphoneos_arch}
  XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] ${iphoneos_arch}
  XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] ""
  XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] ""
)