diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-12-20 11:45:48 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-01-02 15:29:05 +0100 |
| commit | 91a35e1a922e865ca0e9beb43a2be2c5552fc494 (patch) | |
| tree | d12efbc864e83cff8ceaaccdd4181978078acc75 /src/Compilation.zig | |
| parent | a9c75a2b48f202d5c55097877499942ed07cc2e8 (diff) | |
| download | zig-91a35e1a922e865ca0e9beb43a2be2c5552fc494.tar.gz zig-91a35e1a922e865ca0e9beb43a2be2c5552fc494.zip | |
Detect native iframework dirs on macOS
This commit adds default search paths for system frameworks
on macOS while also adding `-isysroot` for OS versions at least BigSur.
Since BigSur (11.0.1), neither headers nor libs exist in standard
root locations (`/usr/include`, `/System/Library/Frameworks`). Instead, they
are now exclusively part of the installed developer toolchain (either
via XCode.app or CLT), and specifying `-isysroot` allows us to keep
using universal search paths such as `/System/Library/Frameworks` while
only changing the include flag from `-iframework` to
`-iframeworkwithsysroot`.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index cd3db84ec2..4fd0e54aa8 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2079,12 +2079,6 @@ pub fn addCCArgs( try argv.append("-ffunction-sections"); } - try argv.ensureCapacity(argv.items.len + comp.bin_file.options.framework_dirs.len * 2); - for (comp.bin_file.options.framework_dirs) |framework_dir| { - argv.appendAssumeCapacity("-iframework"); - argv.appendAssumeCapacity(framework_dir); - } - if (comp.bin_file.options.link_libcpp) { const libcxx_include_path = try std.fs.path.join(arena, &[_][]const u8{ comp.zig_lib_directory.path.?, "libcxx", "include", @@ -2894,6 +2888,7 @@ fn buildOutputFromZig( .directory = null, // Put it in the cache directory. .basename = bin_basename, }; + const sub_compilation = try Compilation.create(comp.gpa, .{ .global_cache_directory = comp.global_cache_directory, .local_cache_directory = comp.global_cache_directory, |
