Skip to content

Commit

Permalink
MacOS linker warns fixed (no zigcc)
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Jan 7, 2024
1 parent 5e180be commit d3f15ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,13 @@ fn buildLDC(b: *Builder, lib: *CompileStep, config: ldcConfig) !*RunStep {
}

// link flags
// GNU LD
if (lib.rootModuleTarget().os.tag == .linux and !config.zig_cc)
try cmds.append("-L--no-as-needed");
// LLD (not working in zld)
if (lib.rootModuleTarget().isDarwin() and !config.zig_cc)
// https://github.com/ldc-developers/ldc/issues/4501
try cmds.append("-L-w"); // resolve linker warnings

// Darwin frameworks
if (lib.rootModuleTarget().isDarwin()) {
Expand Down

0 comments on commit d3f15ec

Please sign in to comment.