@@ -35,33 +35,40 @@ def map_and_list(func, iterable):
35
35
36
36
37
37
# process environment variables
38
- effective_platofrm_name = env ("EFFECTIVE_PLATFORM_NAME" )
38
+ effective_platform_name = env ("EFFECTIVE_PLATFORM_NAME" )
39
39
docset_platform = "iOS"
40
40
default_deployment_target_flag_name = "-mios-simulator-version-min"
41
41
default_deployment_target_clang_env_name = "IPHONEOS_DEPLOYMENT_TARGET"
42
- if effective_platofrm_name is "-macosx" :
42
+ if effective_platform_name is "-macosx" :
43
43
docset_platform = "OSX"
44
44
default_deployment_target_flag_name = "-mmacosx-version-min"
45
45
default_deployment_target_clang_env_name = "MACOSX_DEPLOYMENT_TARGET"
46
- elif effective_platofrm_name is "-watchos" :
46
+ elif effective_platform_name is "-watchos" :
47
47
docset_platform = "watchOS"
48
48
default_deployment_target_flag_name = "-mwatchos-version-min"
49
49
default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET"
50
- elif effective_platofrm_name is "-watchsimulator" :
50
+ elif effective_platform_name is "-watchsimulator" :
51
51
docset_platform = "watchOS"
52
52
default_deployment_target_flag_name = "-mwatchos-simulator-version-min"
53
53
default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET"
54
- elif effective_platofrm_name is "-appletvos" :
54
+ elif effective_platform_name is "-appletvos" :
55
55
docset_platform = "tvOS"
56
56
default_deployment_target_flag_name = "-mappletvos-version-min"
57
57
default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET"
58
- elif effective_platofrm_name is "-appletvsimulator" :
58
+ elif effective_platform_name is "-appletvsimulator" :
59
59
docset_platform = "tvOS"
60
60
default_deployment_target_flag_name = "-mappletvsimulator-version-min"
61
61
default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET"
62
- elif effective_platofrm_name is "-iphoneos" :
62
+ elif effective_platform_name is "-iphoneos" :
63
63
default_deployment_target_flag_name = "-miphoneos-version-min"
64
64
65
+ sdk_version = env ("SDK_VERSION" ) or "13.0"
66
+ llvm_target_triple_suffix = env_or_empty ("LLVM_TARGET_TRIPLE_SUFFIX" )
67
+ llvm_target_triple_os_version = "ios{}" .format (sdk_version )
68
+ # env("LLVM_TARGET_TRIPLE_OS_VERSION") is the deployment target, so doesn't have all APIs
69
+ # usually it's ios9.0 for NativeScript projects
70
+ llvm_target_triple_vendor = env ("LLVM_TARGET_TRIPLE_VENDOR" ) or "apple"
71
+
65
72
conf_build_dir = env ("CONFIGURATION_BUILD_DIR" )
66
73
sdk_root = env ("SDKROOT" )
67
74
src_root = env ("SRCROOT" )
@@ -136,7 +143,7 @@ def generate_metadata(arch):
136
143
if env_or_empty ("IS_UIKITFORMAC" ).capitalize () is "YES" :
137
144
generator_call .extend (["-arch" , arch ])
138
145
else :
139
- generator_call .extend (["-target" , "{}-apple-ios13.0-macabi " .format (arch )])
146
+ generator_call .extend (["-target" , "{}-{}-{}{} " .format (arch , llvm_target_triple_vendor , llvm_target_triple_os_version , llvm_target_triple_suffix )])
140
147
141
148
generator_call .extend (header_search_paths_parsed ) # HEADER_SEARCH_PATHS
142
149
generator_call .extend (framework_search_paths_parsed ) # FRAMEWORK_SEARCH_PATHS
0 commit comments