Skip to content

Commit

Permalink
fix wrapper + build
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Dec 6, 2017
1 parent 4db9500 commit 8051016
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ function find_gpp()
incdir = Pkg.dir("WinRPM","deps","usr","x86_64-w64-mingw32","sys-root","mingw","include")
push!(Base.Libdl.DL_LOAD_PATH, RPMbindir) # TODO does this need to be reversed?
ENV["PATH"] = ENV["PATH"] * ";" * RPMbindir;
return gpp, incdir, "dll"
return gpp, incdir
end
if is_unix()
if success(`g++ --version`)
return "g++", "", is_apple() ? "dylib" : "so"
return "g++", ""
else
error("no g++ found. Please install a version > 4.5")
end
Expand All @@ -37,13 +37,13 @@ catch e
end

cd(path) do
gpp, incdir, ext = find_gpp()
gpp, incdir = find_gpp()
base = joinpath(path, "build")
isdir(base) || mkdir(base)
libo = joinpath(base, "earcut.o")
isfile(libo) && save_rm(libo)
run(`$gpp -c -fPIC -std=c++11 cwrapper.cpp -I $incdir -o $libo`)
lib = joinpath(base, "earcut.$ext")
run(`$gpp -c -fPIC -std=c++11 cwrapper.cpp -o $libo -I $incdir`)
lib = joinpath(base, "earcut.$(Libdl.dlext)")
isfile(lib) && save_rm(lib)
run(`$gpp -shared -o $lib $libo`)
info("Compiled EarCut successfully!")
Expand Down
1 change: 1 addition & 0 deletions src/cwrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ function triangulate(polygon::Vector{Vector{Point{2, Int32}}})
)
unsafe_wrap(Vector{GLTriangle}, array[1], array[2])
end

0 comments on commit 8051016

Please sign in to comment.