From 91a35e1a922e865ca0e9beb43a2be2c5552fc494 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sun, 20 Dec 2020 11:45:48 +0100 Subject: 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`. --- src/Compilation.zig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/Compilation.zig') 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, -- cgit v1.2.3