mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix MacOS SDK.
This commit is contained in:
@@ -311,7 +311,7 @@ typedef struct BuildOptions_
|
||||
WinCrtLinking crt_linking;
|
||||
} win;
|
||||
struct {
|
||||
const char *sdk;
|
||||
const char *sysroot;
|
||||
const char *min_version;
|
||||
const char *sdk_version;
|
||||
} macos;
|
||||
|
||||
@@ -877,7 +877,7 @@ static void parse_option(BuildOptions *options)
|
||||
if (match_longopt("macossdk"))
|
||||
{
|
||||
if (at_end() || next_is_opt()) error_exit("error: --macossdk needs a directory.");
|
||||
options->macos.sdk = check_dir(next_arg());
|
||||
options->macos.sysroot = check_dir(next_arg());
|
||||
return;
|
||||
}
|
||||
if (match_longopt("winsdk"))
|
||||
|
||||
@@ -283,7 +283,7 @@ static void update_build_target_from_options(BuildTarget *target, BuildOptions *
|
||||
if (options->benchfn) target->benchfn = options->benchfn;
|
||||
target->benchmarking = options->benchmarking;
|
||||
target->testing = options->testing;
|
||||
if (options->macos.sdk) target->macos.sysroot = options->macos.sdk;
|
||||
if (options->macos.sysroot) target->macos.sysroot = options->macos.sysroot;
|
||||
if (options->win.sdk) target->win.sdk = options->win.sdk;
|
||||
if (options->macos.min_version) target->macos.min_version = options->macos.min_version;
|
||||
if (options->macos.sdk_version) target->macos.sdk_version = options->macos.sdk_version;
|
||||
|
||||
@@ -296,15 +296,14 @@ static void linker_setup_macos(const char ***args_ref, LinkerType linker_type)
|
||||
// Skip if no libc.
|
||||
if (!link_libc()) return;
|
||||
|
||||
const char *sysroot = active_target.macos.sysroot ? active_target.macos.sysroot : macos_sysroot();
|
||||
if (active_target.macos.sdk)
|
||||
if (!active_target.macos.sdk)
|
||||
{
|
||||
error_exit("Cannot crosslink MacOS without providing --macossdk.");
|
||||
}
|
||||
add_arg("-lSystem");
|
||||
add_arg("-lm");
|
||||
add_arg("-syslibroot");
|
||||
add_arg(sysroot);
|
||||
add_arg(active_target.macos.sysroot);
|
||||
if (is_no_pie(platform_target.reloc_model)) add_arg("-no_pie");
|
||||
if (is_pie(platform_target.reloc_model)) add_arg("-pie");
|
||||
add_arg("-platform_version");
|
||||
|
||||
@@ -1941,7 +1941,9 @@ void target_setup(BuildTarget *target)
|
||||
|
||||
if (platform_target.os == OS_TYPE_MACOSX)
|
||||
{
|
||||
if (!active_target.macos.sysroot) active_target.macos.sysroot = macos_sysroot();
|
||||
const char *sysroot = active_target.macos.sysroot ? active_target.macos.sysroot : macos_sysroot();
|
||||
|
||||
active_target.macos.sdk = NULL;
|
||||
if (sysroot)
|
||||
{
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.4.677"
|
||||
#define COMPILER_VERSION "0.4.678"
|
||||
Reference in New Issue
Block a user