Skip to content

Commit

Permalink
refactor: updated releases build script
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 904ffc0978f80d3b6cdf71df35691f62d2e035388c813952f33f99d2ce32b928
  • Loading branch information
thindil committed Oct 12, 2024
1 parent cde1a7c commit e687e6b
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions others/build.nims
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import std/[distros, os]

# Check if the script was started from the proper location (root directory)
if not fileExists("steamsky.gpr"):
echo "This script must be run in the directory where steamsky.gpr file is"
if not fileExists("steamsky.nimble"):
echo "This script must be run in the directory where steamsky.nimble file is"
quit QuitFailure

# Set the target for the compilation. If no arguments, use system default
Expand All @@ -23,21 +23,11 @@ if target notin ["x86_64-linux-gnu", "x86_64-windows"]:
quit QuitFailure

# Clean and compile the game
rmDir("nim" & DirSep & "obj")
mkDir("nim" & DirSep & "obj")
try:
exec "gprclean -P steamsky.gpr --target=" & target
except:
discard
withDir("nim"):
if target == "x86_64-linux-gnu":
exec "nim release"
else:
exec "nim windows"
rmDir(nimCacheDir().parentDir() & DirSep & "build_r")
if target == "x86_64-linux-gnu":
exec "gprbuild -p -P steamsky.gpr -XMode=release -XOS=Unix --target=" & target
exec "nimble release -y"
else:
exec "gprbuild -p -P steamsky.gpr -XMode=release -XOS=Windows --target=" & target & " -largs -L/opt/lib"
exec "nimble releasewindows -y"
let dirName =
if target == "x86_64-linux-gnu":
"release" & DirSep & "steamsky-linux" & DirSep
Expand Down

0 comments on commit e687e6b

Please sign in to comment.