Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Add support for ios_sim_arm64 CPU type
Browse files Browse the repository at this point in the history
  • Loading branch information
thii authored and keith committed Sep 29, 2021
1 parent 00a73c9 commit 63bab0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
6 changes: 4 additions & 2 deletions src/TulsiGenerator/DeploymentTarget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public enum CPU: String {
case arm64
case arm64e
case arm64_32
case sim_arm64

public static let allCases: [CPU] = [.i386, .x86_64, .armv7, .armv7k, .arm64, .arm64e, .arm64_32]
public static let allCases: [CPU] = [.i386, .x86_64, .armv7, .armv7k, .arm64, .arm64e, .arm64_32, .sim_arm64]

var isARM: Bool {
switch self {
Expand All @@ -35,6 +36,7 @@ public enum CPU: String {
case .arm64: return true
case .arm64e: return true
case .arm64_32: return true
case .sim_arm64: return true
}
}

Expand Down Expand Up @@ -113,7 +115,7 @@ public enum PlatformType: String {

var validCPUs: Set<CPU> {
switch self {
case .ios: return [.i386, .x86_64, .armv7, .arm64, .arm64e]
case .ios: return [.i386, .x86_64, .armv7, .arm64, .arm64e, .sim_arm64]
case .macos: return [.x86_64, .arm64, .arm64e]
case .tvos: return [.x86_64, .arm64]
case .watchos: return [.i386, .x86_64, .armv7k, .arm64_32]
Expand Down
24 changes: 14 additions & 10 deletions src/TulsiGenerator/Scripts/bazel_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,6 @@ def __init__(self, build_settings):

self.update_symbol_cache = UpdateSymbolCache()

# Target architecture. Must be defined for correct setting of
# the --cpu flag. Note that Xcode will set multiple values in
# ARCHS when building for a Generic Device.
archs = os.environ.get('ARCHS')
if not archs:
_PrintXcodeError('Tulsi requires env variable ARCHS to be '
'set. Please file a bug against Tulsi.')
sys.exit(1)
self.arch = archs.split()[-1]

# Path into which generated artifacts should be copied.
self.built_products_dir = os.environ['BUILT_PRODUCTS_DIR']
# Path where Xcode expects generated sources to be placed.
Expand Down Expand Up @@ -521,6 +511,20 @@ def __init__(self, build_settings):
else:
self.codesigning_allowed = os.environ.get('CODE_SIGNING_ALLOWED') == 'YES'

# Target architecture. Must be defined for correct setting of
# the --cpu flag. Note that Xcode will set multiple values in
# ARCHS when building for a Generic Device.
archs = os.environ.get('ARCHS')
if not archs:
_PrintXcodeError('Tulsi requires env variable ARCHS to be '
'set. Please file a bug against Tulsi.')
sys.exit(1)
arch = archs.split()[-1]
if self.is_simulator and arch == "arm64":
self.arch = "sim_" + arch
else:
self.arch = arch

if self.codesigning_allowed:
platform_prefix = 'iOS'
if self.platform_name.startswith('macos'):
Expand Down

0 comments on commit 63bab0d

Please sign in to comment.