Skip to content

Commit

Permalink
upgrade build.cr process and raylib
Browse files Browse the repository at this point in the history
  • Loading branch information
sol-vin committed May 15, 2024
1 parent a5a87e9 commit 70748b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rsrc/build-examples/build.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ FileUtils.cd("examples") do
FileUtils.cd(path) do
`shards install`

output = `crystal build --release -s -p -t -o ../_build/#{path.basename} ./src/#{path.basename}.cr`
output = `crystal build --release -s -p -t -o ../_build/#{path.basename} ./src/#{path.basename}.cr --link-flags --subsystem,windows`

file = "../_build/#{name}"
{% if flag?(:windows) %}
file = "../_build/#{name}.exe"
FileUtils.cp("../../rsrc/native/windows/raylib.dll", "../_build/raylib.dll")
FileUtils.cp("../../rsrc/native/windows/raygui.dll", "../_build/raygui.dll")
{% end %}

unless File.exists?(file)
Expand All @@ -33,6 +31,8 @@ FileUtils.cd("examples") do
puts "Could not find #{FileUtils.pwd}/_build/#{name}.exe"
exit(1)
end


begin
FileUtils.rm("../_build/#{name}.pdb")
rescue
Expand All @@ -43,5 +43,10 @@ FileUtils.cd("examples") do
rescue
end
end

{% if flag?(:windows) %}
FileUtils.cp("../rsrc/native/windows/raylib.dll", "_build/raylib.dll")
FileUtils.cp("../rsrc/native/windows/raygui.dll", "_build/raygui.dll")
{% end %}
end
end
Binary file modified rsrc/native/windows/raylib.dll
Binary file not shown.

0 comments on commit 70748b0

Please sign in to comment.