diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2023-09-15 01:05:14 -0400 |
|---|---|---|
| committer | Michael Dusan <michael.dusan@gmail.com> | 2023-09-25 15:53:05 -0400 |
| commit | 5d6521d2814e6768536103c233d2e283051b9f1e (patch) | |
| tree | bccd4d252a4c9849ae31e76258d6e7d83a35f78b /src/Compilation.zig | |
| parent | 15fd7cd154316e7eb3bf254e249072e562fdbe2c (diff) | |
| download | zig-5d6521d2814e6768536103c233d2e283051b9f1e.tar.gz zig-5d6521d2814e6768536103c233d2e283051b9f1e.zip | |
macos: better SDK version detection
SDK version detection:
- read SDKSettings.json before inferral from SDK path
- vendored libc: add SDKSettings.json for SDK version info
resolveLibSystem:
- adjust search order to { search_dirs, { sysroot or vendored }}
- previous search order was { sysroot, search_dirs, vendored }
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 7cbb64e6c0..e9f6be89fd 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1554,6 +1554,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { .use_lld = use_lld, .use_llvm = use_llvm, .use_lib_llvm = use_lib_llvm, + .libc_provider = libc_dirs.provider, .link_libc = link_libc, .link_libcpp = link_libcpp, .link_libunwind = link_libunwind, @@ -5654,6 +5655,7 @@ const LibCDirs = struct { libc_installation: ?*const LibCInstallation, libc_framework_dir_list: []const []const u8, sysroot: ?[]const u8, + provider: link.LibCProvider, }; fn getZigShippedLibCIncludeDirsDarwin(arena: Allocator, zig_lib_dir: []const u8) !LibCDirs { @@ -5669,6 +5671,7 @@ fn getZigShippedLibCIncludeDirsDarwin(arena: Allocator, zig_lib_dir: []const u8) .libc_installation = null, .libc_framework_dir_list = &.{}, .sysroot = null, + .provider = .vendored, }; } @@ -5686,6 +5689,7 @@ pub fn detectLibCIncludeDirs( .libc_installation = null, .libc_framework_dir_list = &.{}, .sysroot = null, + .provider = .none, }; } @@ -5743,6 +5747,7 @@ pub fn detectLibCIncludeDirs( .libc_installation = null, .libc_framework_dir_list = &.{}, .sysroot = null, + .provider = .none, }; } @@ -5797,6 +5802,7 @@ fn detectLibCFromLibCInstallation(arena: Allocator, target: Target, lci: *const .libc_installation = lci, .libc_framework_dir_list = framework_list.items, .sysroot = sysroot, + .provider = if (sysroot == null) .installation else .sysroot, }; } @@ -5858,6 +5864,7 @@ fn detectLibCFromBuilding( .libc_installation = null, .libc_framework_dir_list = &.{}, .sysroot = null, + .provider = .vendored, }; } |
