From 1e41a4e576348ef33e48ff5204af0d1fa5247385 Mon Sep 17 00:00:00 2001 From: Gnimuc Date: Tue, 20 Aug 2024 22:25:07 +0900 Subject: [PATCH 1/2] Add compiler version selection support in `get_default_args` --- src/generator/context.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/generator/context.jl b/src/generator/context.jl index 1f0ed43d..0018106b 100644 --- a/src/generator/context.jl +++ b/src/generator/context.jl @@ -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.11" + 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 From f1e3c37b7ef54a0b7f983661464c8403dc308ce8 Mon Sep 17 00:00:00 2001 From: Gnimuc Date: Tue, 20 Aug 2024 23:17:24 +0900 Subject: [PATCH 2/2] fix-up --- src/generator/context.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generator/context.jl b/src/generator/context.jl index 0018106b..1d43ca15 100644 --- a/src/generator/context.jl +++ b/src/generator/context.jl @@ -240,7 +240,7 @@ function get_default_args(triple=get_triple(); is_cxx=false, version=GCC_MIN_VER if is_cxx env = get_default_env(triple; version, is_cxx) args = ["-isystem" * dir for dir in get_system_includes(env)] - @static if Base.VERSION < v"1.11" + @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")