Skip to content

Commit

Permalink
clean up + MaterialX (#16)
Browse files Browse the repository at this point in the history
* clean up + MaterialX

* fix macros
  • Loading branch information
SimonDanisch authored Mar 7, 2023
1 parent 27b4c47 commit a5367dc
Show file tree
Hide file tree
Showing 4 changed files with 2,211 additions and 13 deletions.
4 changes: 4 additions & 0 deletions build/error-checking.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function check_error(error_code)
error_code == RPR_SUCCESS && return
return error("Error code returned: $(error_code)")
end
19 changes: 6 additions & 13 deletions build/generate-master.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using Clang
using Clang.Generators

cd(@__DIR__)


# current version checked in is v2.2.9
include_dir = normpath(joinpath(@__DIR__, "RadeonProRenderSDK", "RadeonProRender", "inc"))
# LIBCLANG_HEADERS are those headers to be wrapped.
headers = joinpath.(include_dir, [
"RadeonProRender_v2.h",
# "RadeonProRender_GL.h",
"RadeonProRender_MaterialX.h"
# "RRadeonProRender_v2adeonProRender_GL.h",
# "RadeonProRender_VK.h"
])

Expand All @@ -18,10 +20,8 @@ options = load_options(joinpath(@__DIR__, "rpr.toml"))
args = get_default_args()

push!(args, "-I$include_dir")
gcc = replace(args[3], "-isystem" => "")
push!(args, "-I$(joinpath(gcc, "c++", "4.8.5"))")

# push!(args, "-I/usr/include/c++/9/")
push!(args, "-D__APPLE__")
push!(args, "-DRPR_API_USE_HEADER_V2")
ctx = create_context(headers, args, options)
# run generator
build!(ctx, BUILDSTAGE_NO_PRINTING)
Expand Down Expand Up @@ -60,12 +60,5 @@ end

rewrite!(ctx.dag)

quote
function check_error(error_code)
error_code == RPR_SUCCESS && return
return error("Error code returned: $(error_code)")
end
end

cd(@__DIR__)
build!(ctx, BUILDSTAGE_PRINTING_ONLY)
2 changes: 2 additions & 0 deletions build/rpr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ output_file_path = "../src/LibRPR.jl"
module_name = "RPR"
jll_pkg_name = "RadeonProRender_jll"
export_symbol_prefixes = ["RPR", "rpr"]
extract_c_comment_style = "doxygen"
prologue_file_path = "./error-checking.jl"
Loading

0 comments on commit a5367dc

Please sign in to comment.