Skip to content
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

Add compiler version selection support in get_default_args #506

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions src/generator/context.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,15 @@ function get_triple()
end
end

function get_default_args(triple=get_triple(); is_cxx=false)
function get_default_args(triple=get_triple(); is_cxx=false, version=GCC_MIN_VER)
if is_cxx
env = get_default_env(triple; version=GCC_MIN_VER, is_cxx)
env = get_default_env(triple; version, is_cxx)
args = ["-isystem" * dir for dir in get_system_includes(env)]
clang_inc = joinpath(LLVM_LIBDIR, "clang", string(Base.libllvm_version.major), "include")
@static if Base.VERSION <= v"1.10"
clang_inc = joinpath(LLVM_LIBDIR, "clang", string(Base.libllvm_version), "include")
else
clang_inc = joinpath(LLVM_LIBDIR, "clang", string(Base.libllvm_version.major), "include")
end
push!(args, "-isystem" * clang_inc)
push!(args, "--target=$(target(env.platform))")
return args
Expand Down
Loading