Skip to content

Fix Meson build failures by separating macOS compile-time and link-time flags #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
])

if Sys.isapple(p)
macos_version_flags = clang_use_lld ? (min_macos_version_flags()[1],) : min_macos_version_flags()
append!(flags, String[
macos_version_flags...,
])
# Only add the compile-time flag here
append!(flags, String[
min_macos_version_flags()[1], # -mmacosx-version-min=...
])
end

sanitize_compile_flags!(p, flags)
Expand Down Expand Up @@ -534,6 +534,12 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
if Sys.isapple(p)
push!(flags, "-headerpad_max_install_names")
end

if Sys.isapple(p) && !clang_use_lld
# Add the linker-specific flag only when linking
push!(flags, min_macos_version_flags()[2]) # -Wl,-sdk_version,...
end

return flags
end

Expand Down