From 76e53cebac05ffa6e2cc4a4357cc95ad46844375 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 18 Jan 2024 22:56:42 +0100 Subject: [PATCH] Improved the new test app's linux build script and created them for other platforms. --- tools/merger/test_app/compile_linux.sh | 8 ++------ tools/merger/test_app/compile_osx.sh | 17 +++++++++++++++++ tools/merger/test_app/compile_vs.bat | 15 +++++++++++++++ tools/merger/test_app/compile_windows.sh | 13 +++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100755 tools/merger/test_app/compile_osx.sh create mode 100644 tools/merger/test_app/compile_vs.bat create mode 100755 tools/merger/test_app/compile_windows.sh diff --git a/tools/merger/test_app/compile_linux.sh b/tools/merger/test_app/compile_linux.sh index 7e3e26a..00454b0 100755 --- a/tools/merger/test_app/compile_linux.sh +++ b/tools/merger/test_app/compile_linux.sh @@ -2,12 +2,8 @@ cp -u ../out/full/sfw.h sfw.h cp -u ../out/full/sfw.cpp sfw.cpp cp -u ../out/full/sfw_3rd.m sfw_3rd.m - ccache g++ -Wall -g -c sfw.cpp -o sfw.o -ccache g++ -Wall -g -c game_scene.cpp -o game_scene.o -ccache g++ -Wall -g -c main.cpp -o main.o - -#-static-libgcc -static-libstdc++ +ccache g++ -Wall -g -c game_scene.cpp -o game_scene.o +ccache g++ -Wall -g -c main.cpp -o main.o ccache g++ -Wall -lX11 -static-libgcc -static-libstdc++ -g sfw.o game_scene.o main.o -o game - diff --git a/tools/merger/test_app/compile_osx.sh b/tools/merger/test_app/compile_osx.sh new file mode 100755 index 0000000..d807bf2 --- /dev/null +++ b/tools/merger/test_app/compile_osx.sh @@ -0,0 +1,17 @@ +cp -u ../out/full/sfw.h sfw.h +cp -u ../out/full/sfw.cpp sfw.cpp +cp -u ../out/full/sfw_3rd.m sfw_3rd.m + +export SDKROOT=$(xcrun --show-sdk-path) + +export args="-std=c++14 -w -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox " + +clang++ $args -g -c sfw.cpp -o sfw.o +clang++ -w -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox -g -c sfw_3rd.m -o sfw_3rd.o + +clang++ $args -g -c game_scene.cpp -o game_scene.o +clang++ $args -g -c main.cpp -o main.o + +# You might need to add -lpthread and/or -latomic depending on your compiler version + +clang++ $args -g sfw.o sfw_3rd.o game_scene.o main.o -o game diff --git a/tools/merger/test_app/compile_vs.bat b/tools/merger/test_app/compile_vs.bat new file mode 100644 index 0000000..145f15c --- /dev/null +++ b/tools/merger/test_app/compile_vs.bat @@ -0,0 +1,15 @@ +@echo off + +if not defined DevEnvDir ( + call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 +) + +rem debug: /Zi (== -g) + +cl /EHsc /Zi /c sfw.cpp /Fo:sfw.obj +cl /EHsc /Zi /c game_scene.cpp /Fo:game_scene.obj +cl /EHsc /Zi /c main.cpp /Fo:main.obj + +cl /Zi /EHsc /Fegame-vc.exe ^ + sfw.obj game_scene.obj main.obj ^ + /SUBSYSTEM:CONSOLE diff --git a/tools/merger/test_app/compile_windows.sh b/tools/merger/test_app/compile_windows.sh new file mode 100755 index 0000000..a5418f0 --- /dev/null +++ b/tools/merger/test_app/compile_windows.sh @@ -0,0 +1,13 @@ +cp -u ../out/full/sfw.h sfw.h +cp -u ../out/full/sfw.cpp sfw.cpp +cp -u ../out/full/sfw_3rd.m sfw_3rd.m + +ccache g++ -Wall -g -c sfw.cpp -o sfw.o +ccache g++ -Wall -g -c game_scene.cpp -o game_scene.o +ccache g++ -Wall -g -c main.cpp -o main.o + +# You might need to add -lpthread and/or -latomic depending on your compiler version + +ccache g++ -Wall -g sfw.o game_scene.o main.o \ + -lgdi32 -lShlwapi -lws2_32 \ + -o game