-
Notifications
You must be signed in to change notification settings - Fork 50
Simplify build procedure #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1f2853f
Move build script logic to cpp
saccarosium f3ac14a
Update CI
saccarosium 9d29bda
Update README
saccarosium 02e2300
Add support for Visual Studio 2026
saccarosium 51590ec
Update after review
saccarosium beba30e
Add executable flag to build.sh
80cb952
Remove the .vscode folder (my bad)
ef417b7
Fix build.bat
saccarosium b7829de
Remove DO_CRAZY_EXPENSIVE_ASSERTS
saccarosium 6d0e23a
Use -o for optimiziations
saccarosium 5311492
Define WIN32_* backend only on windows
saccarosium File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| @echo off | ||
|
|
||
| set prev_cwd=%cd% | ||
|
|
||
| rem Make sure we are at the root of the project | ||
| cd /D "%~dp0" | ||
|
|
||
| set src_root=%cd%\code | ||
| set custom_root=%src_root%\custom | ||
| set build_root=%cd%\build | ||
|
|
||
| rem If the user want's 32 bits they need to setup MSVC before calling the script. | ||
| call %custom_root%\bin\setup_cl_x64.bat | ||
|
|
||
| set opts=/nologo /FC /Zi /I%src_root% /I%custom_root% | ||
|
|
||
| if not exist "%build_root%" mkdir %build_root% | ||
| pushd %build_root% | ||
| call cl %opts% %src_root%\4ed_build.cpp /Febuild | ||
| popd | ||
|
|
||
| if %ERRORLEVEL% neq 0 goto END | ||
|
|
||
| %build_root%\build.exe %* | ||
|
|
||
| :END | ||
| cd /D "%prev_cwd%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/sh | ||
|
|
||
| # '/bin/sh' is the most portable way to write a shellscript but doesn't | ||
| # support some features that bash does (e.g. using '[[' is not supported | ||
| # you can you '['). | ||
| # | ||
| # To be sure that the script is portable and fully POSIX # compliant use a | ||
| # tool like shellcheck to validate it. | ||
| # | ||
| # https://github.com/koalaman/shellcheck | ||
|
|
||
| # shellcheck disable=SC2048,SC2086 | ||
|
|
||
| set -e | ||
|
|
||
| # Make sure we are at the root of the project | ||
| cd "$(realpath "$(dirname "$0")")" | ||
|
|
||
| SRC_ROOT="$PWD/code" | ||
| CUSTOM_ROOT="$SRC_ROOT/custom" | ||
| BUILD_ROOT="$PWD/build" | ||
|
|
||
| # c++ is the default toolchain's compiler installed on the machine | ||
| if [ -z "$CC" ]; then | ||
| CC=c++ | ||
| fi | ||
|
|
||
| CFLAGS="-D_GNU_SOURCE -fPIC -fpermissive -Wno-write-strings -Wno-comment" | ||
| CFLAGS="$CFLAGS -Wno-null-dereference -Wno-logical-op-parentheses -Wno-switch" | ||
| CFLAGS="$CFLAGS -I$SRC_ROOT -I$CUSTOM_ROOT" | ||
|
|
||
| if [ ! -d "$BUILD_ROOT" ]; then | ||
| mkdir -p "$BUILD_ROOT" | ||
| fi | ||
|
|
||
| eval "$CC $CFLAGS $SRC_ROOT/4ed_build.cpp -g -o $BUILD_ROOT/build" | ||
|
|
||
| "$BUILD_ROOT/build" $* |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.