Skip to content

Commit

Permalink
feat: Create separate build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
enzoevers committed May 14, 2024
1 parent 5bffd8e commit 53b1713
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 19 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#----- Begin -----

build

# See Scripts/Variables.sh
Code/BuildDoc
Code/BuildDesktop
Code/BuildStm32*
Code/BuildTest
Build

dist

Expand Down
4 changes: 3 additions & 1 deletion Scripts/Desktop/BuildDesktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

CreateBuildDirectoryIfNotExist ${BUILD_PATH}

ValidateDirExists ${CODE_PATH}

CreateBuildDirectoryIfNotExist ${BUILD_DIR_DESKTOP}

cd ${BUILD_DIR_DESKTOP}
cmake -G Ninja .. -DUSE_DESKTOP=ON -DHANOVER_OL037A=ON
cmake -G Ninja ${CODE_PATH} -DUSE_DESKTOP=ON -DHANOVER_OL037A=ON
cmake --build . --parallel 8
2 changes: 1 addition & 1 deletion Scripts/Desktop/CleanDesktopBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

ValidateDirExists ${CODE_PATH}
ValidateDirExists ${BUILD_PATH}

DeleteBuildDirectoryIfExist ${BUILD_DIR_DESKTOP}
4 changes: 3 additions & 1 deletion Scripts/Doc/BuildDoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

CreateBuildDirectoryIfNotExist ${BUILD_PATH}

ValidateDirExists ${CODE_PATH}

CreateBuildDirectoryIfNotExist ${BUILD_DIR_DOC}

cd ${BUILD_DIR_DOC}
cmake .. -DGENERATE_DOCS=ON
cmake ${CODE_PATH} -DGENERATE_DOCS=ON
doxygen Doc/Doxyfile.doxygen
2 changes: 1 addition & 1 deletion Scripts/Doc/CleanDocBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

ValidateDirExists ${CODE_PATH}
ValidateDirExists ${BUILD_PATH}

DeleteBuildDirectoryIfExist ${BUILD_DIR_DOC}
4 changes: 3 additions & 1 deletion Scripts/Stm32/Stm32f303xc/BuildStm32f303xc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ SCRIPT_PATH=${CUR_PATH}/../../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

CreateBuildDirectoryIfNotExist ${BUILD_PATH}

ValidateDirExists ${CODE_PATH}

CreateBuildDirectoryIfNotExist ${BUILD_DIR_STM32F303XC}

cd ${BUILD_DIR_STM32F303XC}
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug -DUSE_STM32=ON -DUSE_STM32F3=ON -DUSE_STM32F303XC=ON -DHANOVER_OL037A=ON
cmake -G Ninja ${CODE_PATH} -DCMAKE_BUILD_TYPE=Debug -DUSE_STM32=ON -DUSE_STM32F3=ON -DUSE_STM32F303XC=ON -DHANOVER_OL037A=ON
cmake --build . --parallel 8
2 changes: 1 addition & 1 deletion Scripts/Stm32/Stm32f303xc/CleanStm32f303xcBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SCRIPT_PATH=${CUR_PATH}/../../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

ValidateDirExists ${CODE_PATH}
ValidateDirExists ${BUILD_PATH}

DeleteBuildDirectoryIfExist ${BUILD_DIR_STM32F303XC}
4 changes: 3 additions & 1 deletion Scripts/Test/BuildTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

CreateBuildDirectoryIfNotExist ${BUILD_PATH}

ValidateDirExists ${CODE_PATH}

CreateBuildDirectoryIfNotExist ${BUILD_DIR_TEST}

cd ${BUILD_DIR_TEST}
CC=clang-17 CXX=clang++-17 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug -DTEST_ON_PC=ON
CC=clang-17 CXX=clang++-17 cmake -G Ninja ${CODE_PATH} -DCMAKE_BUILD_TYPE=Debug -DTEST_ON_PC=ON
cmake --build . --parallel 8
2 changes: 1 addition & 1 deletion Scripts/Test/CleanTestBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

ValidateDirExists ${CODE_PATH}
ValidateDirExists ${BUILD_PATH}

DeleteBuildDirectoryIfExist ${BUILD_DIR_TEST}
2 changes: 1 addition & 1 deletion Scripts/Test/RunTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SCRIPT_PATH=${CUR_PATH}/../
source ${SCRIPT_PATH}/Variables.sh
source ${SCRIPT_PATH}/Utils.sh

ValidateDirExists ${CODE_PATH}
ValidateDirExists ${BUILD_PATH}

RETURN_CODE=0
EvaluateTests()
Expand Down
9 changes: 5 additions & 4 deletions Scripts/Variables.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

CODE_PATH="${SCRIPT_PATH}/../Code/"
BUILD_PATH="${SCRIPT_PATH}/../Build/"

# The full path to the build directory for the desktop target
BUILD_DIR_DESKTOP="${CODE_PATH}/BuildDesktop"
BUILD_DIR_DESKTOP="${BUILD_PATH}/BuildDesktop"

# The full path to the build directory for the desktop target
BUILD_DIR_STM32F303XC="${CODE_PATH}/BuildStm32f303xc"
BUILD_DIR_STM32F303XC="${BUILD_PATH}/BuildStm32f303xc"

# The full path to the build directory for the tests
BUILD_DIR_TEST="${CODE_PATH}/BuildTest"
BUILD_DIR_TEST="${BUILD_PATH}/BuildTest"

# The full path to the build directory for the documentation
BUILD_DIR_DOC="${CODE_PATH}/BuildDoc"
BUILD_DIR_DOC="${BUILD_PATH}/BuildDoc"

APPLICATION_NAME="LedDisplayDriverExecutable"

0 comments on commit 53b1713

Please sign in to comment.