updates linux scripts
parent
55db1098b8
commit
f2954aa6c1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,17 +1,32 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
||||||
REM This script expects to be run from the parent directory
|
REM This script expects to be run from the parent directory
|
||||||
REM ex. scripts/build.bat
|
REM ex. scripts/build.bat
|
||||||
|
|
||||||
|
REM Sets the escape char. see for info:
|
||||||
|
REM https://stackoverflow.com/questions/55891318/how-to-echo-with-different-colors-in-the-windows-command-line-inside-a-for-loop
|
||||||
|
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
|
||||||
|
|
||||||
IF not exist build/ (
|
IF not exist build/ (
|
||||||
echo This script needs to be run from the directory above build/
|
echo This script needs to be run from the directory above build/
|
||||||
goto END
|
goto END
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cmake --build build/ --target all
|
||||||
|
|
||||||
IF "%~1" == "r" (
|
SET BUILD_ERRORLEVEL=!ERRORLEVEL!
|
||||||
cmake --build build/ --target ALL_BUILD --config Release
|
IF NOT "!BUILD_ERRORLEVEL!"=="0" (
|
||||||
) ELSE (
|
echo %ESC%[91mBUILD FAILED!%ESC%[0m %BUILD_ERRORLEVEL%
|
||||||
cmake --build build/ --target ALL_BUILD --config Debug
|
EXIT /B !BUILD_ERRORLEVEL!
|
||||||
)
|
)
|
||||||
|
|
||||||
:END
|
IF not exist build/bin/shaders (
|
||||||
|
mkdir build/bin/shaders
|
||||||
|
)
|
||||||
|
|
||||||
|
REM TODO: Run any extra tasks here
|
||||||
|
|
||||||
|
echo %ESC%[92mBUILD SUCCEEDED!%ESC%[0m
|
||||||
|
|
||||||
|
:END
|
||||||
|
ENDLOCAL
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# This script expects to be run from the parent directory
|
||||||
|
# ex. scripts/build.sh
|
||||||
|
|
||||||
|
#Colors
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
echo building project...
|
||||||
|
cmake --build build/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "${GREEN}BUILD SUCCESSFUL${NC}"
|
||||||
|
else
|
||||||
|
echo "${RED}BUILD FAILED${NC}"
|
||||||
|
fi
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
rm -r build
|
||||||
|
mkdir build
|
||||||
@ -1,7 +1,44 @@
|
|||||||
@echo off
|
@echo off
|
||||||
REM This script expects to be run from the parent directory
|
REM This script expects to be run from the parent directory
|
||||||
REM ex. scripts/cmconfig.bat
|
REM ex. scripts/config.bat
|
||||||
@echo off
|
REM script options (like -c and -r) must come before any cmake options (EXAMPLE_BASIC, NO_DIAG, etc)
|
||||||
|
|
||||||
|
|
||||||
|
set options=
|
||||||
|
set build_type=
|
||||||
|
|
||||||
|
IF "%1"=="" goto command
|
||||||
|
goto loop
|
||||||
|
|
||||||
|
|
||||||
|
:command
|
||||||
|
IF "%build_type%"=="" (
|
||||||
|
set build_type=-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
echo Build mode is Debug
|
||||||
|
)
|
||||||
|
echo using options %options%
|
||||||
|
:: cmake -Wno-dev %build_type% %options% -B build/ -S . -G "Visual Studio 17 2022" -A x64
|
||||||
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -Wno-dev -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang %build_type% %options% -B build/ -S . -G Ninja
|
||||||
|
goto exit
|
||||||
|
|
||||||
|
:loop
|
||||||
|
|
||||||
|
IF "%1"=="-c" (
|
||||||
|
call scripts\clean.bat
|
||||||
|
goto loop_condition
|
||||||
|
)
|
||||||
|
|
||||||
|
IF "%1"=="-r" (
|
||||||
|
echo Build mode is release
|
||||||
|
set build_type=-DCMAKE_BUILD_TYPE=Release
|
||||||
|
goto loop_condition
|
||||||
|
)
|
||||||
|
|
||||||
|
set options=%options%-D%1=ON
|
||||||
|
|
||||||
|
:loop_condition
|
||||||
|
shift
|
||||||
|
IF "%1"=="" goto command
|
||||||
|
goto loop
|
||||||
|
|
||||||
cmake -Wno-dev -B build/ -S . -G "Visual Studio 17 2022" -A x64
|
:exit
|
||||||
|
|||||||
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# This script expects to be run from the parent directory
|
||||||
|
# ex. scripts/config.sh
|
||||||
|
|
||||||
|
#Colors
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
options=
|
||||||
|
build_type=-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
|
||||||
|
until [ "$1" = "" ]
|
||||||
|
do
|
||||||
|
|
||||||
|
if [ "$1" = "-r" ]
|
||||||
|
then
|
||||||
|
build_type=-DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
|
elif [ "$1" = "-c" ]
|
||||||
|
then
|
||||||
|
rm -r build
|
||||||
|
mkdir build
|
||||||
|
else
|
||||||
|
options="$options -D$1=ON"
|
||||||
|
fi
|
||||||
|
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
echo using options: $options
|
||||||
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang $build_type -Wno-dev $options -S . -B build/
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "${GREEN}cmake config successful!${NC}"
|
||||||
|
else
|
||||||
|
echo "${RED}cmake config failed. Cleaning partial config.${NC}"
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue