Embed fonts into the executable, ship release artifacts as bare binaries
Fonts are now baked in with #load and loaded via LoadFontFromMemory instead of LoadFontEx reading assets/*.ttf from disk, so a build no longer needs an assets/ folder next to it at runtime - the chdir to the executable's own directory in main.odin is dead code, removed. just package / just package-windows now produce a single executable (build/<name>_<version>_<os>_<arch>[.exe]) instead of a tar.gz/zip, and the release workflow's upload/release-asset globs and the lld/zip toolchain package list are updated to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f39ed1684b
commit
ad7d19b85a
7 files changed
+36
-36
No files matched your search
@@ -36,16 +36,15 @@ test:
|
||||
# `ulimit` line wouldn't carry over to the `odin test` line.)
|
||||
ulimit -s 8192 && odin test tests -vet -define:ODIN_TEST_THREADS=1 -out:{{build_dir}}/tests
|
||||
|
||||
# Optimized native build into build/<os>/, with the assets it needs at runtime
|
||||
# Optimized native build into build/<os>/<name> (self-contained: fonts are embedded)
|
||||
release:
|
||||
mkdir -p {{build_dir}}/{{os()}}/{{name}}
|
||||
odin build . -vet -o:speed -out:{{build_dir}}/{{os()}}/{{name}}/{{name}}
|
||||
cp -R assets {{build_dir}}/{{os()}}/{{name}}/
|
||||
mkdir -p {{build_dir}}/{{os()}}
|
||||
odin build . -vet -o:speed -out:{{build_dir}}/{{os()}}/{{name}}
|
||||
|
||||
# Native release build packed as build/<name>_<version>_<os>_<arch>.tar.gz
|
||||
# Native release build as build/<name>_<version>_<os>_<arch>
|
||||
package version="dev": release
|
||||
tar -czf {{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}.tar.gz -C {{build_dir}}/{{os()}} {{name}}
|
||||
@echo "{{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}.tar.gz"
|
||||
cp {{build_dir}}/{{os()}}/{{name}} {{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}
|
||||
@echo "{{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}"
|
||||
|
||||
# Download the Windows SDK + CRT (via xwin, accepting Microsoft's license) and raylib.lib. Linux x86_64 only.
|
||||
windows-deps:
|
||||
@@ -67,12 +66,12 @@ windows-deps:
|
||||
unzip -o -j {{build_dir}}/odin-windows.zip 'dist/vendor/raylib/windows/raylib.lib' -d "{{raylib_windows}}"
|
||||
fi
|
||||
|
||||
# Cross-compile a Windows x86_64 build into build/windows/ (run `just windows-deps` first)
|
||||
# Cross-compile a self-contained Windows x86_64 build into build/windows/ (run `just windows-deps` first)
|
||||
windows:
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
obj_dir={{build_dir}}/obj-windows
|
||||
out_dir={{build_dir}}/windows/{{name}}
|
||||
out_dir={{build_dir}}/windows
|
||||
mkdir -p "$obj_dir" "$out_dir"
|
||||
rm -f "$obj_dir"/*.obj
|
||||
odin build . -vet -o:speed -target:windows_amd64 -build-mode:obj -out:"$obj_dir/{{name}}.obj"
|
||||
@@ -88,12 +87,11 @@ windows:
|
||||
libcmt.lib libvcruntime.lib ucrt.lib \
|
||||
kernel32.lib user32.lib gdi32.lib winmm.lib shell32.lib opengl32.lib \
|
||||
advapi32.lib bcrypt.lib ntdll.lib synchronization.lib ole32.lib
|
||||
cp -R assets "$out_dir/"
|
||||
|
||||
# Windows build packed as build/<name>_<version>_windows_x86_64.zip
|
||||
# Windows build as build/<name>_<version>_windows_x86_64.exe
|
||||
package-windows version="dev": windows
|
||||
cd {{build_dir}}/windows && zip -qr ../{{name}}_{{version}}_windows_x86_64.zip {{name}}
|
||||
@echo "{{build_dir}}/{{name}}_{{version}}_windows_x86_64.zip"
|
||||
cp {{build_dir}}/windows/{{name}}.exe {{build_dir}}/{{name}}_{{version}}_windows_x86_64.exe
|
||||
@echo "{{build_dir}}/{{name}}_{{version}}_windows_x86_64.exe"
|
||||
|
||||
# Format all Odin files with odinfmt (settings in odinfmt.json)
|
||||
fmt:
|
||||
|
||||
Reference in new issue
Block a user