mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-17 00:11:25 -07:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -436,7 +436,9 @@ struct BuildContext {
|
||||
BlockingMutex target_features_mutex;
|
||||
StringSet target_features_set;
|
||||
String target_features_string;
|
||||
|
||||
String minimum_os_version_string;
|
||||
bool minimum_os_version_string_given;
|
||||
};
|
||||
|
||||
gb_global BuildContext build_context = {0};
|
||||
@@ -1419,7 +1421,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
|
||||
bc->metrics = *metrics;
|
||||
if (metrics->os == TargetOs_darwin) {
|
||||
if (bc->minimum_os_version_string.len == 0) {
|
||||
if (!bc->minimum_os_version_string_given) {
|
||||
bc->minimum_os_version_string = str_lit("11.0.0");
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -1115,7 +1115,16 @@ gb_internal void init_universal(void) {
|
||||
|
||||
add_global_constant("ODIN_COMPILE_TIMESTAMP", t_untyped_integer, exact_value_i64(odin_compile_timestamp()));
|
||||
|
||||
add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", lb_use_new_pass_system() && !is_arch_wasm());
|
||||
{
|
||||
bool f16_supported = lb_use_new_pass_system();
|
||||
if (is_arch_wasm()) {
|
||||
f16_supported = false;
|
||||
} else if (build_context.metrics.os == TargetOs_darwin && build_context.metrics.arch == TargetArch_amd64) {
|
||||
// NOTE(laytan): See #3222 for my ramblings on this.
|
||||
f16_supported = false;
|
||||
}
|
||||
add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", f16_supported);
|
||||
}
|
||||
|
||||
{
|
||||
GlobalEnumValue values[3] = {
|
||||
|
||||
+4
-1
@@ -502,9 +502,12 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib ");
|
||||
}
|
||||
|
||||
if (build_context.minimum_os_version_string.len) {
|
||||
// Only specify this flag if the user has given a minimum version to target.
|
||||
// This will cause warnings to show up for mismatched libraries.
|
||||
if (build_context.minimum_os_version_string_given) {
|
||||
link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string));
|
||||
}
|
||||
|
||||
// This points the linker to where the entry point is
|
||||
link_settings = gb_string_appendc(link_settings, "-e _main ");
|
||||
}
|
||||
|
||||
+2
-1
@@ -1066,6 +1066,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
||||
case BuildFlag_MinimumOSVersion: {
|
||||
GB_ASSERT(value.kind == ExactValue_String);
|
||||
build_context.minimum_os_version_string = value.value_string;
|
||||
build_context.minimum_os_version_string_given = true;
|
||||
break;
|
||||
}
|
||||
case BuildFlag_RelocMode: {
|
||||
@@ -1926,7 +1927,7 @@ gb_internal void print_show_help(String const arg0, String const &command) {
|
||||
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, "Default: -minimum-os-version:11.0.0");
|
||||
print_usage_line(2, "(Only used when target is Darwin.)");
|
||||
print_usage_line(2, "Only used when target is Darwin, if given, linking mismatched versions will emit a warning.");
|
||||
print_usage_line(0, "");
|
||||
|
||||
print_usage_line(1, "-extra-linker-flags:<string>");
|
||||
|
||||
Reference in New Issue
Block a user