mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-26 05:38:14 +00:00
Rename iOS subtarget to iPhone for consistency.
Add `ODIN_PLATFORM_SUBTARGET_IOS` builtin constant which evaluated to `true` when the platform is `Darwin` and the subtarget it either `iPhone` or `iPhoneSimulator`
This commit is contained in:
@@ -171,7 +171,7 @@ struct TargetMetrics {
|
||||
|
||||
enum Subtarget : u32 {
|
||||
Subtarget_Default,
|
||||
Subtarget_iOS,
|
||||
Subtarget_iPhone,
|
||||
Subtarget_iPhoneSimulator,
|
||||
Subtarget_Android,
|
||||
|
||||
@@ -180,7 +180,7 @@ enum Subtarget : u32 {
|
||||
|
||||
gb_global String subtarget_strings[Subtarget_COUNT] = {
|
||||
str_lit(""),
|
||||
str_lit("ios"),
|
||||
str_lit("iphone"),
|
||||
str_lit("iphonesimulator"),
|
||||
str_lit("android"),
|
||||
};
|
||||
@@ -1828,7 +1828,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
|
||||
if (metrics->os == TargetOs_darwin) {
|
||||
switch (subtarget) {
|
||||
case Subtarget_iOS:
|
||||
case Subtarget_iPhone:
|
||||
switch (metrics->arch) {
|
||||
case TargetArch_arm64:
|
||||
bc->metrics.target_triplet = str_lit("arm64-apple-ios");
|
||||
@@ -1909,7 +1909,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
if (!bc->minimum_os_version_string_given) {
|
||||
if (subtarget == Subtarget_Default) {
|
||||
bc->minimum_os_version_string = str_lit("11.0.0");
|
||||
} else if (subtarget == Subtarget_iOS || subtarget == Subtarget_iPhoneSimulator) {
|
||||
} else if (subtarget == Subtarget_iPhone || subtarget == Subtarget_iPhoneSimulator) {
|
||||
// NOTE(harold): We default to 17.4 on iOS because that's when os_sync_wait_on_address was added and
|
||||
// we'd like to avoid any potential App Store issues by using the private ulock_* there.
|
||||
bc->minimum_os_version_string = str_lit("17.4");
|
||||
@@ -1917,7 +1917,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
}
|
||||
|
||||
if (subtarget == Subtarget_iPhoneSimulator) {
|
||||
// For the iOS simulator subtarget, the version must be between 'ios' and '-simulator'.
|
||||
// For the iPhoneSimulator subtarget, the version must be between 'ios' and '-simulator'.
|
||||
String suffix = str_lit("-simulator");
|
||||
GB_ASSERT(string_ends_with(bc->metrics.target_triplet, suffix));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user