mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -510,7 +510,7 @@ gb_global TargetMetrics target_darwin_amd64 = {
|
||||
TargetOs_darwin,
|
||||
TargetArch_amd64,
|
||||
8, 8, 8, 16,
|
||||
str_lit("x86_64-apple-darwin"),
|
||||
str_lit("x86_64-apple-macosx"), // NOTE: Changes during initialization based on build flags.
|
||||
str_lit("e-m:o-i64:64-f80:128-n8:16:32:64-S128"),
|
||||
};
|
||||
|
||||
@@ -518,7 +518,7 @@ gb_global TargetMetrics target_darwin_arm64 = {
|
||||
TargetOs_darwin,
|
||||
TargetArch_arm64,
|
||||
8, 8, 8, 16,
|
||||
str_lit("arm64-apple-macosx11.0.0"),
|
||||
str_lit("arm64-apple-macosx"), // NOTE: Changes during initialization based on build flags.
|
||||
str_lit("e-m:o-i64:64-i128:128-n32:64-S128"),
|
||||
};
|
||||
|
||||
@@ -1418,19 +1418,25 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
}
|
||||
|
||||
bc->metrics = *metrics;
|
||||
switch (subtarget) {
|
||||
case Subtarget_Default:
|
||||
break;
|
||||
case Subtarget_iOS:
|
||||
GB_ASSERT(metrics->os == TargetOs_darwin);
|
||||
if (metrics->arch == TargetArch_arm64) {
|
||||
bc->metrics.target_triplet = str_lit("arm64-apple-ios");
|
||||
} else if (metrics->arch == TargetArch_amd64) {
|
||||
bc->metrics.target_triplet = str_lit("x86_64-apple-ios");
|
||||
} else {
|
||||
GB_PANIC("Unknown architecture for darwin");
|
||||
if (metrics->os == TargetOs_darwin) {
|
||||
if (bc->minimum_os_version_string.len == 0) {
|
||||
bc->minimum_os_version_string = str_lit("11.0.0");
|
||||
}
|
||||
|
||||
switch (subtarget) {
|
||||
case Subtarget_Default:
|
||||
bc->metrics.target_triplet = concatenate_strings(permanent_allocator(), bc->metrics.target_triplet, bc->minimum_os_version_string);
|
||||
break;
|
||||
case Subtarget_iOS:
|
||||
if (metrics->arch == TargetArch_arm64) {
|
||||
bc->metrics.target_triplet = str_lit("arm64-apple-ios");
|
||||
} else if (metrics->arch == TargetArch_amd64) {
|
||||
bc->metrics.target_triplet = str_lit("x86_64-apple-ios");
|
||||
} else {
|
||||
GB_PANIC("Unknown architecture for darwin");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
bc->ODIN_OS = target_os_names[metrics->os];
|
||||
|
||||
@@ -502,7 +502,6 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib ");
|
||||
}
|
||||
|
||||
// This sets a requirement of Mountain Lion and up, but the compiler doesn't work without this limit.
|
||||
if (build_context.minimum_os_version_string.len) {
|
||||
link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string));
|
||||
}
|
||||
@@ -513,7 +512,9 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
||||
if (!build_context.no_crt) {
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lm ");
|
||||
if (build_context.metrics.os == TargetOs_darwin) {
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lSystem ");
|
||||
// NOTE: adding this causes a warning about duplicate libraries, I think it is
|
||||
// automatically assumed/added by clang when you don't do `-nostdlib`.
|
||||
// platform_lib_str = gb_string_appendc(platform_lib_str, "-lSystem ");
|
||||
} else {
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lc ");
|
||||
}
|
||||
|
||||
@@ -1925,7 +1925,7 @@ gb_internal void print_show_help(String const arg0, String const &command) {
|
||||
if (run_or_build) {
|
||||
print_usage_line(1, "-minimum-os-version:<string>");
|
||||
print_usage_line(2, "Sets the minimum OS version targeted by the application.");
|
||||
print_usage_line(2, "Example: -minimum-os-version:12.0.0");
|
||||
print_usage_line(2, "Default: -minimum-os-version:11.0.0");
|
||||
print_usage_line(2, "(Only used when target is Darwin.)");
|
||||
print_usage_line(0, "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user