Skip to content

Commit

Permalink
Add cal to system headers and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Apr 27, 2024
1 parent 278a23a commit a4224d6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The LibAwsCommon.jl package is licensed under the MIT "Expat" License:
The LibAwsIO.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2024: Jacob Quinn and Ryan Benasutti
>
Expand Down
6 changes: 3 additions & 3 deletions gen/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "91c208284b82a779e5b263a7d22a3c34a0736693"
project_hash = "46342e1b48a16f578d983378fc2b627a4124a3d5"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
Expand Down Expand Up @@ -209,9 +209,9 @@ version = "1.2.13+1"

[[deps.aws_c_cal_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "aws_c_common_jll"]
git-tree-sha1 = "7425bc9d167f7982c277d22609bc036a00ff1466"
git-tree-sha1 = "3c554279cdb445fbebdab0b9f9fcc470c6d488b0"
uuid = "70f11efc-bab2-57f1-b0f3-22aad4e67c4b"
version = "0.6.11+0"
version = "0.6.12+0"

[[deps.aws_c_common_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down
2 changes: 2 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
JLLPrefixes = "afc68a34-7891-4c5a-9da1-1c62935e7b0d"
aws_c_cal_jll = "70f11efc-bab2-57f1-b0f3-22aad4e67c4b"
aws_c_common_jll = "73048d1d-b8c4-5092-a58d-866c5e8d1e50"
aws_c_io_jll = "13c41daa-f319-5298-b5eb-5754e0170d52"

[compat]
Clang = "0.18.3"
JLLPrefixes = "0.3"
aws_c_cal_jll = "=0.6.12"
aws_c_common_jll = "=0.9.14"
aws_c_io_jll = "=0.14.7"
20 changes: 4 additions & 16 deletions gen/generator.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Clang.Generators
using Clang.JLLEnvs
using JLLPrefixes
import aws_c_common_jll, aws_c_io_jll
import aws_c_common_jll, aws_c_io_jll, aws_c_cal_jll

cd(@__DIR__)

const refs_to_remove = []

# This is called if the docs generated from the extract_c_comment_style method did not generate any lines.
# We need to generate at least some docs so that cross-references work with Documenter.jl.
function get_docs(node, docs)
Expand All @@ -21,19 +19,6 @@ function get_docs(node, docs)
return ["Documentation not found."]
end

# remove references to things which don't exist because it causes Documenter.jl's cross_references check to fail
for ref in refs_to_remove
for doci in eachindex(docs)
docs[doci] = replace(docs[doci], "[`$ref`](@ref)" => "`$ref`")
end
end

# # fix other random stuff
# for doci in eachindex(docs)
# # fix some code that gets bogus references inserted
# docs[doci] = replace(docs[doci], "for (struct [`aws_hash_iter`](@ref) iter = [`aws_hash_iter_begin`](@ref)(&map); ![`aws_hash_iter_done`](@ref)(&iter); [`aws_hash_iter_next`](@ref)(&iter)) { const key\\_type key = *(const key\\_type *)iter.element.key; value\\_type value = *(value\\_type *)iter.element.value; // etc. }" => "`for (struct aws_hash_iter iter = aws_hash_iter_begin(&map); !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) { const key\\_type key = *(const key\\_type *)iter.element.key; value\\_type value = *(value\\_type *)iter.element.value; // etc. }`")
# end

return docs
end

Expand Down Expand Up @@ -62,6 +47,9 @@ for target in JLLEnvs.JLL_ENV_TRIPLES
inc = JLLEnvs.get_pkg_include_dir(aws_c_common_jll, target)
push!(args, "-isystem$inc")

inc = JLLEnvs.get_pkg_include_dir(aws_c_cal_jll, target)
push!(args, "-isystem$inc")

header_dirs = []
inc = JLLEnvs.get_pkg_include_dir(aws_c_io_jll, target)
push!(args, "-I$inc")
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ using Test, Aqua, LibAwsIO, LibAwsCommon
end
@testset "basic usage to test the library loads" begin
alloc = aws_default_allocator() # important! this shouldn't need to be qualified! if we generate a definition for it in LibAwsIO that is a bug.
aws_future_void_new(alloc)
aws_io_library_init(alloc)
end
end

0 comments on commit a4224d6

Please sign in to comment.