Skip to content

Commit

Permalink
Add support for libclang 16
Browse files Browse the repository at this point in the history
  • Loading branch information
krrutkow committed Mar 9, 2024
1 parent 6b3bddb commit da1ba22
Show file tree
Hide file tree
Showing 5 changed files with 7,619 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
- '1.7'
- '1.8'
- '1.9'
- '1.10-nightly'
- '1.10'
- '1.11-nightly'
- 'nightly'
os:
- ubuntu-latest
- macos-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CBinding"
uuid = "d43a6710-96b8-4a2d-833c-c424785e5374"
authors = ["Keith Rutkowski <[email protected]>"]
version = "1.0.11"
version = "1.0.12"

[deps]
Clang_jll = "0ee61d77-7f21-5576-8119-9fcc46b10100"
Expand All @@ -10,6 +10,6 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"

[compat]
Clang_jll = "^9, ^11, ^12, ^13, ^14, ^15"
Clang_jll = "^9, ^11, ^12, ^13, ^14, ^15, ^16"
Scratch = "^1"
julia = "^1.5"
6 changes: 4 additions & 2 deletions deps/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const LIBCLANG_PATH = get(ARGS, 1, Clang_jll.libclang_path)
const LIBLLVM_PATH = get(ARGS, 2, joinpath(dirname(Base.julia_cmd().exec[1]), Base.LIBDIR, "julia", "libLLVM.so"))

withenv("LD_LIBRARY_PATH" => get(ENV, "LD_LIBRARY_PATH", "")*":"*normpath(dirname(LIBLLVM_PATH))) do
dlopen(LIBLLVM_PATH) do lib # needed to hijack the libLLVM that clank will be linked to
dlopen(LIBLLVM_PATH) do lib # needed to hijack the libLLVM that libclang will be linked to
version = CBinding.libclang_version(LIBCLANG_PATH)

@eval c`-std=c99 -I$(dirname(dirname(LIBCLANG_PATH)))/include -L$(dirname(LIBCLANG_PATH)) -lclang`
@eval c"""
#include <time.h>
Expand Down Expand Up @@ -55,7 +57,7 @@ withenv("LD_LIBRARY_PATH" => get(ENV, "LD_LIBRARY_PATH", "")*":"*normpath(dirnam


libclang = sanitize(string(libclang)) # NOTE: do this _before_ we truncate the file!
open(joinpath(@__DIR__, "libclang-$(CBinding.libclang_version(LIBCLANG_PATH)).jl"), "w+") do io
open(joinpath(@__DIR__, "libclang-$(version).jl"), "w+") do io
println(io, libclang)
end
end
Expand Down
Loading

0 comments on commit da1ba22

Please sign in to comment.