diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7c5d8ca..0d6ce88 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -36,22 +36,31 @@ jobs: uses: jakoch/install-vulkan-sdk-action@v1 - name: Configure debug - run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-debug.sh + run: | + mkdir -p build/debug + cd build/debug + CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug - name: Configure release - run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-release.sh + run: | + mkdir -p build/release + cd build/release + CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release - name: Configure RelWithDeb - run: cd scripts; CPM_SOURCE_CACHE="~/.cache/CPM/" ./configure-relwithdeb.sh + run: | + mkdir -p build/relwithdeb + cd build/relwithdeb + CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo - name: Build debug - run: cd scripts; ./build-debug.sh + run: cd build/debug && ninja - name: Build release - run: cd scripts; ./build-release.sh + run: cd build/release && ninja - name: Build Release with debug info - run: cd scripts; ./build-relwithdeb.sh + run: cd build/relwithdeb && ninja - name: Copy assets run: |- diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ec66a8b..9d7fac9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,77 +1,197 @@ { - "version": "2.0.0", - "tasks": [ - { - "label": "Configure: Debug", - "type": "shell", - "command": "cd scripts; ./configure-debug.sh", - "group": { - "isDefault": false - }, - "problemMatcher": [], - "detail": "Configure Debug" - }, - { - "label": "Build: Debug", - "type": "shell", - "command": "cd scripts; ./build-debug.sh", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [], - "detail": "Build Debug" - }, - { - "label": "Configure: Relwithdeb", - "type": "shell", - "command": "cd scripts; ./configure-relwithdeb.sh", - "group": { - "isDefault": false - }, - "problemMatcher": [], - "detail": "Configure Release with debug info" - }, - { - "label": "Build: Relwithdeb", - "type": "shell", - "command": "cd scripts; ./build-relwithdeb.sh", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [], - "detail": "Build Release with debug info" - }, - { - "label": "Clean: Debug", - "type": "shell", - "command": "cd build/debug; ninja clean", - "group": { - "isDefault": false - }, - "detail": "Clean debug files" - }, - { - "label": "Build: All", - "type": "shell", - "command": "cd scripts; ./build.sh", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [], - "detail": "Build all types" - }, - { - "label": "Clean: All", - "type": "shell", - "command": "cd scripts; ./clean.sh", - "group": { - "isDefault": false - }, - "problemMatcher": [], - "detail": "Clean All files" + "version": "2.0.0", + "tasks": [ + { + "label": "Configure: Debug", + "type": "shell", + "command": "./scripts/build_script configure -b debug", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' configure -b debug" + ], + "options": { + "cwd": "${workspaceFolder}" } - ] + }, + "group": { + "isDefault": false + }, + "problemMatcher": [], + "detail": "Configure Debug" + }, + { + "label": "Build: Debug", + "type": "shell", + "command": "./scripts/build_script build -b debug", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' build -b debug" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Build Debug" + }, + { + "label": "Configure: Relwithdeb", + "type": "shell", + "command": "./scripts/build_script configure -b relwithdeb", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' configure -b relwithdeb" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "isDefault": false + }, + "problemMatcher": [], + "detail": "Configure Release with debug info" + }, + { + "label": "Build: Relwithdeb", + "type": "shell", + "command": "./scripts/build_script build -b relwithdeb", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' build -b relwithdeb" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Build Release with debug info" + }, + { + "label": "Configure: Release", + "type": "shell", + "command": "./scripts/build_script configure -b release", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' configure -b release" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "isDefault": false + }, + "problemMatcher": [], + "detail": "Configure Release" + }, + { + "label": "Build: Release", + "type": "shell", + "command": "./scripts/build_script build -b release", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' build -b release" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Build Release" + }, + { + "label": "Clean: Debug", + "type": "shell", + "command": "./scripts/build_script clean -b debug", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' clean -b debug" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "isDefault": false + }, + "detail": "Clean debug files" + }, + { + "label": "Build: All", + "type": "shell", + "command": "./scripts/build_script build", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' build" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Build all types" + }, + { + "label": "Clean: All", + "type": "shell", + "command": "./scripts/build_script clean", + "windows": { + "command": "powershell.exe", + "args": [ + "-NoProfile", + "-Command", + "& './scripts/build_script.exe' clean" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + "group": { + "isDefault": false + }, + "problemMatcher": [], + "detail": "Clean All files" + } + ] } diff --git a/CMakeLists.txt b/CMakeLists.txt index 47b917d..ccfce24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,11 @@ set(CMAKE_CXX_STANDARD 20) # Include the libary add_subdirectory(oatmeal) +set(BUILD_SHARED_LIBS OFF) file(GLOB CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/*.cmake") foreach(cmake_file ${CMAKE_FILES}) - include(${cmake_file}) + include(${cmake_file}) endforeach() # TODO: Add a check to disable compiling the examples diff --git a/scripts/build-debug.sh b/scripts/build-debug.sh deleted file mode 100755 index 497b992..0000000 --- a/scripts/build-debug.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p debug -cd debug -ninja diff --git a/scripts/build-release.sh b/scripts/build-release.sh deleted file mode 100755 index 01fa218..0000000 --- a/scripts/build-release.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p release -cd release -ninja diff --git a/scripts/build-relwithdeb.sh b/scripts/build-relwithdeb.sh deleted file mode 100755 index 396dca8..0000000 --- a/scripts/build-relwithdeb.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p relwithdeb -cd relwithdeb -ninja diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index fa2fa6a..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -cd ../ -mkdir -p build -cd build || exit -mkdir -p debug -mkdir -p release -mkdir -p relwithdeb - -cd debug || exit -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug & -cd ../ -cd release || exit -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release & -cd ../ -cd relwithdeb || exit -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo & -cd ../ - -wait - -cd debug || exit -ninja & -cd ../ -cd release || exit -ninja & -cd ../ -cd relwithdeb || exit -ninja & -cd ../.. - -wait diff --git a/scripts/build_script b/scripts/build_script new file mode 100644 index 0000000..44d0471 Binary files /dev/null and b/scripts/build_script differ diff --git a/scripts/build_script.exe b/scripts/build_script.exe new file mode 100644 index 0000000..7a0f028 Binary files /dev/null and b/scripts/build_script.exe differ diff --git a/scripts/clean.sh b/scripts/clean.sh deleted file mode 100755 index 3595225..0000000 --- a/scripts/clean.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -cd .. -cd build/debug || exit -ninja clean - -cd .. -cd release || exit -ninja clean - -cd .. -cd relwithdeb || exit -ninja clean diff --git a/scripts/configure-debug.sh b/scripts/configure-debug.sh deleted file mode 100755 index e269ff2..0000000 --- a/scripts/configure-debug.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p debug -cd debug -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug diff --git a/scripts/configure-release.sh b/scripts/configure-release.sh deleted file mode 100755 index e6a1d81..0000000 --- a/scripts/configure-release.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p release -cd release -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release diff --git a/scripts/configure-relwithdeb.sh b/scripts/configure-relwithdeb.sh deleted file mode 100755 index fa79d5b..0000000 --- a/scripts/configure-relwithdeb.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash - -cd .. -mkdir -p build -cd build -mkdir -p relwithdeb -cd relwithdeb -cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo