From 32d5c3d0a81239cb58e4b4d116a6f93a8e0671ec Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 12:02:22 +0800 Subject: [PATCH 01/26] new doxygen config --- .gitignore | 4 ++++ Doxyfile | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Doxyfile diff --git a/.gitignore b/.gitignore index 84caa0a0..b516ccdc 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +# Doxygen's file +doxydoc/ + +# some plugins 3rdparty/ # User-specific stuff diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 00000000..188f0c5e --- /dev/null +++ b/Doxyfile @@ -0,0 +1,11 @@ + PROJECT_NAME = "something" + OUTPUT_DIRECTORY = ./doxydoc/ + BUILTIN_STL_SUPPORT = YES + EXTRACT_ALL = YES + INPUT = ./src ./include + RECURSIVE = YES + HIDE_UNDOC_RELATIONS = NO + HAVE_DOT = YES + UML_LOOK = YES + CALL_GRAPH = YES + CALLER_GRAPH = YES From bd0e708f7bc947d9b522c95c100b6f85b7192457 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 12:46:05 +0800 Subject: [PATCH 02/26] fix the sdl2 not found --- cmake/Dependencies.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 9163e27f..19974631 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -42,6 +42,8 @@ FetchContent_Declare( FetchContent_GetProperties(soloud) if (NOT soloud_POPULATED) FetchContent_Populate(soloud) + + set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD/3rdparty/sdl2/include) add_subdirectory(${soloud_SOURCE_DIR}/contrib) endif() From abd51caf7f1b3be8e44d200852ca9497a9f381ed Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:08:09 +0800 Subject: [PATCH 03/26] test1 --- .github/workflows/main.yml | 112 +++++++++-------------------- .github/workflows/multi_system.yml | 16 ++--- cmake/Dependencies.cmake | 64 ----------------- 3 files changed, 39 insertions(+), 153 deletions(-) delete mode 100644 cmake/Dependencies.cmake diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9d41004..28ca1132 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,86 +1,38 @@ +name: Compile -name: main-before - -on: +on: merge_group: pull_request: -# linux-gcc jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Installing Dependencies - run: | - sudo apt-get update - sudo apt-get -y install gcc cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Building Project - if: matrix.os == 'ubuntu-latest' - env: - CC: gcc - CXX: g++ - run: | - cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - cmake --build build - -# jobs: -# build: -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# os: [ubuntu-latest] -# compiler: [{ cc: gcc, cxx: g++ }, { cc: clang, cxx: clang++ }] -# build_type: [Debug] -# binary: [linux-binary] -# include: -# - os: windows-latest -# build_type: Debug -# binary: windows-binary - -# steps: -# - if: matrix.os == 'ubuntu-latest' -# name: Installing Dependencies -# run: | -# sudo apt-get update -# sudo apt-get -y install ${{ matrix.compiler.cc }} cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - -# - name: Checkout Repository -# uses: actions/checkout@v3 -# with: -# submodules: recursive - -# - name: Check Format -# if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang' -# run: | -# find src/ include/ test/ assets/shaders/ -name "*.*" -print0 | \ -# xargs -0 clang-format --dry-run --Werror --ferror-limit=15 - -# - name: Building Project -# if: matrix.os == 'ubuntu-latest' -# env: -# CC: ${{ matrix.compiler.cc }} -# CXX: ${{ matrix.compiler.cxx }} -# run: | -# cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -# cmake --build build - -# - name: Run Linter -# if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang' -# run: | -# find src/ include/ test/ -name "*.*" -print0 | \ -# xargs -0 run-clang-tidy true -p build - -# - name: Building Project -# if: matrix.os == 'windows-latest' -# run: | -# cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -# cmake --build build --config ${{ matrix.build_type }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + # - os: ubuntu-latest + # compiler: gcc + # - os: ubuntu-latest + # compiler: clang + # - os: windows-latest + # compiler: msvc + # - os: windows-latest + # compiler: mingw + - os: macos-latest + compiler: clang + + step: + - name: "Checkout Repository" + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: "Setup required packages" + run: | + brew install cmake ninja mesa-glu mesa xorg-server + + - name: "Setup cmake" + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Debug + cmake --build build diff --git a/.github/workflows/multi_system.yml b/.github/workflows/multi_system.yml index b1a1ccc1..1d250ec9 100644 --- a/.github/workflows/multi_system.yml +++ b/.github/workflows/multi_system.yml @@ -1,12 +1,10 @@ - name: main -on: +on: merge_group: pull_request: jobs: - windows-visual-studio: runs-on: windows-latest steps: @@ -21,10 +19,11 @@ jobs: submodules: recursive - name: "Setup cmake" + run: | cmake -B build -DCMAKE_BUILD_TYPE=Debug cmake --build build - + windows-mingw: runs-on: windows-latest steps: @@ -35,7 +34,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - + - name: "Build" run: | cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" @@ -49,12 +48,11 @@ jobs: - name: "Setup required packages" run: brew install cmake ninja mesa-glu mesa xorg-server - - name: Checkout Repository uses: actions/checkout@v3 with: submodules: recursive - + - name: Building Project run: | cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug @@ -77,7 +75,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - + - name: Building Project env: CC: clang @@ -85,7 +83,7 @@ jobs: run: | cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug cmake --build build - + linux-gcc: runs-on: ubuntu-latest steps: diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake deleted file mode 100644 index 19974631..00000000 --- a/cmake/Dependencies.cmake +++ /dev/null @@ -1,64 +0,0 @@ -include(FetchContent) - -# FetchContent_Declare( -# Corrosion -# GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git -# GIT_TAG master -# ) -# FetchContent_MakeAvailable(Corrosion) - -message(STATUS "Tinyxml2 NOT FOUND, fetching from source!") -FetchContent_Declare( - tinyxml2 - GIT_REPOSITORY https://github.com/leethomason/TinyXML2 - GIT_TAG 9.0.0 - - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tinyxml2 -) -FetchContent_MakeAvailable(tinyxml2) - -message(STATUS "PTSD NOT FOUND, fetching from source!") -set(PTSD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD") -FetchContent_Declare( - PTSD - GIT_REPOSITORY https://github.com/NTUT-FUCK-PTSD/practical-tools-for-simple-design.git - GIT_TAG v1.2.5 - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD -) -FetchContent_MakeAvailable(PTSD) - -message(STATUS "PTSD: ${PTSD_SOURCE_DIR}") - -message(STATUS "soloud NOT FOUND, fetching from source!") -FetchContent_Declare( - soloud - GIT_REPOSITORY https://github.com/onon1101/soloud.git - # GIT_TAG noinst - GIT_TAG onon1101-patch-2 - - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/soloud -) - -FetchContent_GetProperties(soloud) -if (NOT soloud_POPULATED) - FetchContent_Populate(soloud) - - set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD/3rdparty/sdl2/include) - add_subdirectory(${soloud_SOURCE_DIR}/contrib) -endif() - -message(STATUS "soloud: ${soloud_SOURCE_DIR}") - - -#FetchContent_GetProperties(PTSD) -#if(NOT PTSD_POPULATED) -# FetchContent_Populate(PTSD) -# add_subdirectory(${PTSD_SOURCE_DIR} ${PTSD_BINARY_DIR}) -#endif() - -#include_directories(${PTSD_SOURCE_DIR}/include) - -#add_library(PTSD INTERFACE) - -#target_include_directories(PTSD INTERFACE ${asio_SOURCE_DIR}/PTSD/include) - From 4efe8c47d7ba3cf41fdbcc612b7a3a14ad807dea Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:08:56 +0800 Subject: [PATCH 04/26] push --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28ca1132..5779e556 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,6 @@ name: Compile -on: - merge_group: - pull_request: +on: push jobs: build: From 04076c1ab4824ed49fbebb0f1384e7abef49a2a1 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:12:40 +0800 Subject: [PATCH 05/26] test --- .github/workflows/main.yml | 24 +++++++------- cmake/Dependencies.cmake | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 cmake/Dependencies.cmake diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5779e556..d9be52a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,17 +20,17 @@ jobs: - os: macos-latest compiler: clang - step: - - name: "Checkout Repository" - uses: actions/checkout@v4 - with: - submodules: recursive + steps: + - name: "Checkout Repository" + uses: actions/checkout@v4 + with: + submodules: recursive - - name: "Setup required packages" - run: | - brew install cmake ninja mesa-glu mesa xorg-server + - name: "Setup required packages" + run: | + brew install cmake ninja mesa-glu mesa xorg-server - - name: "Setup cmake" - run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug - cmake --build build + - name: "Setup cmake" + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Debug + cmake --build build diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake new file mode 100644 index 00000000..3046bd83 --- /dev/null +++ b/cmake/Dependencies.cmake @@ -0,0 +1,64 @@ +include(FetchContent) + +# FetchContent_Declare( +# Corrosion +# GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git +# GIT_TAG master +# ) +# FetchContent_MakeAvailable(Corrosion) + +message(STATUS "Tinyxml2 NOT FOUND, fetching from source!") +FetchContent_Declare( + tinyxml2 + GIT_REPOSITORY https://github.com/leethomason/TinyXML2 + GIT_TAG 9.0.0 + + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tinyxml2 +) +FetchContent_MakeAvailable(tinyxml2) + +message(STATUS "PTSD NOT FOUND, fetching from source!") +set(PTSD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD") +FetchContent_Declare( + PTSD + GIT_REPOSITORY https://github.com/NTUT-FUCK-PTSD/practical-tools-for-simple-design.git + GIT_TAG v1.2.5 + URL_HASH MD5=c3e956114176a1cd8903b84f326d12c9 + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD +) +FetchContent_MakeAvailable(PTSD) + +message(STATUS "PTSD: ${PTSD_SOURCE_DIR}") + +message(STATUS "soloud NOT FOUND, fetching from source!") +FetchContent_Declare( + soloud + GIT_REPOSITORY https://github.com/onon1101/soloud.git + GIT_TAG onon1101-patch-2 + + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/soloud +) + +FetchContent_GetProperties(soloud) +if (NOT soloud_POPULATED) + FetchContent_Populate(soloud) + + set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/PTSD/3rdparty/sdl2/include) + add_subdirectory(${soloud_SOURCE_DIR}/contrib) +endif() + +message(STATUS "soloud: ${soloud_SOURCE_DIR}") + + +#FetchContent_GetProperties(PTSD) +#if(NOT PTSD_POPULATED) +# FetchContent_Populate(PTSD) +# add_subdirectory(${PTSD_SOURCE_DIR} ${PTSD_BINARY_DIR}) +#endif() + +#include_directories(${PTSD_SOURCE_DIR}/include) + +#add_library(PTSD INTERFACE) + +#target_include_directories(PTSD INTERFACE ${asio_SOURCE_DIR}/PTSD/include) + From ddd3d4150cbf318fa64bd486b1f254d6dc727d35 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:15:12 +0800 Subject: [PATCH 06/26] ninja --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9be52a9..699a677f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,8 @@ jobs: # compiler: mingw - os: macos-latest compiler: clang + deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server + generator: Ninja steps: - name: "Checkout Repository" @@ -26,11 +28,7 @@ jobs: with: submodules: recursive - - name: "Setup required packages" - run: | - brew install cmake ninja mesa-glu mesa xorg-server - - name: "Setup cmake" run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug + cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "Ninja" cmake --build build From d998dd372da10a824e98c82f04892b575c61d342 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:18:10 +0800 Subject: [PATCH 07/26] remove ninja --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 699a677f..35ddaa45 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,5 +30,5 @@ jobs: - name: "Setup cmake" run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "Ninja" + cmake -B build -DCMAKE_BUILD_TYPE=Debug cmake --build build From cc2ab785fa52b54fa50eb4cd7dc204fe079021e4 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:19:46 +0800 Subject: [PATCH 08/26] test --- .github/workflows/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35ddaa45..aed062b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,14 @@ jobs: with: submodules: recursive + - name: Install Dependencies + shell: bash + run: | + if [[ ! -z "${{ matrix.config.deps_cmdline }}" ]]; then + eval ${{ matrix.config.deps_cmdline }} + fi + - name: "Setup cmake" run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug + cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "${{ matrix.config.generator }}" cmake --build build From 5a542de5941cfd06a2782678c0f514b80f2c2c43 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:21:46 +0800 Subject: [PATCH 09/26] test --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aed062b4..9b67f23d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,10 @@ jobs: fail-fast: false matrix: config: - # - os: ubuntu-latest - # compiler: gcc - # - os: ubuntu-latest - # compiler: clang + - os: ubuntu-latest + compiler: gcc + - os: ubuntu-latest + compiler: clang # - os: windows-latest # compiler: msvc # - os: windows-latest From f96156997952849fac54479980dcb67a9f966c19 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:23:23 +0800 Subject: [PATCH 10/26] test --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b67f23d..c6f6914c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,16 +11,20 @@ jobs: config: - os: ubuntu-latest compiler: gcc + generator: Ninja + deps_cmdline: sudo apt-get update && sudo apt-get -y install gcc cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - os: ubuntu-latest compiler: clang + generator: Ninja + deps_cmdline: sudo apt-get update && sudo apt-get -y install clang cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev # - os: windows-latest # compiler: msvc # - os: windows-latest # compiler: mingw - os: macos-latest compiler: clang - deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server generator: Ninja + deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server steps: - name: "Checkout Repository" From c271a9a6eefa0296f3e607fd920b0e032b2a9373 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:27:39 +0800 Subject: [PATCH 11/26] test --- .github/workflows/main.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6f6914c..850c1460 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,16 +17,21 @@ jobs: compiler: clang generator: Ninja deps_cmdline: sudo apt-get update && sudo apt-get -y install clang cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - # - os: windows-latest - # compiler: msvc - # - os: windows-latest - # compiler: mingw + - os: windows-latest + compiler: msvc + # - os: windows-latest + # compiler: mingw + generator: Ninja - os: macos-latest compiler: clang generator: Ninja deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server steps: + - if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'mingw' + name: "Set Windows-MSVC-Compiler" + uses: egor-tensin/vs-shell@v2 + - name: "Checkout Repository" uses: actions/checkout@v4 with: From 79928eb9d71752165d46f51d8ed439004e3a7846 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:28:24 +0800 Subject: [PATCH 12/26] test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 850c1460..1b8adde7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: compiler: msvc # - os: windows-latest # compiler: mingw - generator: Ninja + # generator: Ninja - os: macos-latest compiler: clang generator: Ninja From 733b0ebc52ed83685f921ed4096fa9fb2e44f53b Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:29:28 +0800 Subject: [PATCH 13/26] msvc --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b8adde7..08cd4672 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,7 @@ jobs: deps_cmdline: sudo apt-get update && sudo apt-get -y install clang cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - os: windows-latest compiler: msvc + generator: Visual Studio 17 2022 # - os: windows-latest # compiler: mingw # generator: Ninja From 9c79564902049b171d310280fb3447fd20719666 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:31:16 +0800 Subject: [PATCH 14/26] mingw --- .github/workflows/main.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08cd4672..f8dbd403 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,18 +20,22 @@ jobs: - os: windows-latest compiler: msvc generator: Visual Studio 17 2022 - # - os: windows-latest - # compiler: mingw - # generator: Ninja + - os: windows-latest + compiler: mingw + generator: Ninja - os: macos-latest compiler: clang generator: Ninja deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server steps: + # - if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'msvc' + # name: "Set Windows-MSVC-Compiler" + # uses: egor-tensin/vs-shell@v2 + - if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'mingw' - name: "Set Windows-MSVC-Compiler" - uses: egor-tensin/vs-shell@v2 + name: "Set Windows-MinGW-Compiler" + uses: seanmiddleditch/gha-setup-ninja@master - name: "Checkout Repository" uses: actions/checkout@v4 From 793758e48054c80d311019ea528f474a7e3697fc Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:32:31 +0800 Subject: [PATCH 15/26] mingw --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8dbd403..07a3c5ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: generator: Visual Studio 17 2022 - os: windows-latest compiler: mingw - generator: Ninja + generator: MinGW Makefiles - os: macos-latest compiler: clang generator: Ninja From b004a114817a4d342fb04f15a965708dba2baf41 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:38:26 +0800 Subject: [PATCH 16/26] test --- .github/workflows/clang-format-check.yml | 19 +++++++++++++++++++ .github/workflows/main.yml | 4 ---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/clang-format-check.yml diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 00000000..fa171666 --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,19 @@ +name: clang-format Check +on: [push, pull_request] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - "src" + - "include" + steps: + - uses: actions/checkout@v3 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: "18" + check-path: ${{ matrix.path }} + fallback-style: "Mozilla" # optional diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07a3c5ab..dbe52d17 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,10 +29,6 @@ jobs: deps_cmdline: brew install cmake ninja mesa-glu mesa xorg-server steps: - # - if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'msvc' - # name: "Set Windows-MSVC-Compiler" - # uses: egor-tensin/vs-shell@v2 - - if: matrix.config.os == 'windows-latest' && matrix.config.compiler == 'mingw' name: "Set Windows-MinGW-Compiler" uses: seanmiddleditch/gha-setup-ninja@master From 516f5294b412ca5244dc4ebe9abfcb866de6dad7 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:40:45 +0800 Subject: [PATCH 17/26] format --- include/Player/Equipment/Shovel/SComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Player/Equipment/Shovel/SComponent.h b/include/Player/Equipment/Shovel/SComponent.h index ec725a47..5ccead87 100644 --- a/include/Player/Equipment/Shovel/SComponent.h +++ b/include/Player/Equipment/Shovel/SComponent.h @@ -15,7 +15,7 @@ namespace ToolSystem { // Dig Level struct DigLevel { explicit DigLevel(std::vector _level) - : level(_level) {}; + : level(_level){}; std::vector level; }; From 9a7c7291bc8f21abdfa6979884fca4346e809fe0 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:44:37 +0800 Subject: [PATCH 18/26] test --- .github/workflows/clang-format-check.yml | 38 ++++++++++++------------ .github/workflows/main.yml | 17 +++++++++++ 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index fa171666..1f29b4e0 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -1,19 +1,19 @@ -name: clang-format Check -on: [push, pull_request] -jobs: - formatting-check: - name: Formatting Check - runs-on: ubuntu-latest - strategy: - matrix: - path: - - "src" - - "include" - steps: - - uses: actions/checkout@v3 - - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.11.0 - with: - clang-format-version: "18" - check-path: ${{ matrix.path }} - fallback-style: "Mozilla" # optional +# name: clang-format Check +# on: [push, pull_request] +# jobs: +# formatting-check: +# name: Formatting Check +# runs-on: ubuntu-latest +# strategy: +# matrix: +# path: +# - "src" +# - "include" +# steps: +# - uses: actions/checkout@v3 +# - name: Run clang-format style check for C/C++/Protobuf programs. +# uses: jidicula/clang-format-action@v4.11.0 +# with: +# clang-format-version: "18" +# check-path: ${{ matrix.path }} +# fallback-style: "Mozilla" # optional diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbe52d17..eb874ba1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,3 +49,20 @@ jobs: run: | cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "${{ matrix.config.generator }}" cmake --build build + + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - "src" + - "include" + steps: + - uses: actions/checkout@v3 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: "18" + check-path: ${{ matrix.path }} + fallback-style: "Mozilla" # optional From 85c92a37c198f9519d361831723be931b72533b8 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:46:32 +0800 Subject: [PATCH 19/26] test --- include/Player/Equipment/Shovel/SComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Player/Equipment/Shovel/SComponent.h b/include/Player/Equipment/Shovel/SComponent.h index 5ccead87..ec725a47 100644 --- a/include/Player/Equipment/Shovel/SComponent.h +++ b/include/Player/Equipment/Shovel/SComponent.h @@ -15,7 +15,7 @@ namespace ToolSystem { // Dig Level struct DigLevel { explicit DigLevel(std::vector _level) - : level(_level){}; + : level(_level) {}; std::vector level; }; From ed0050fa143e1bfb983c4efbc06ff54df20ece81 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:52:15 +0800 Subject: [PATCH 20/26] test --- .github/workflows/clang-format-check.yml | 19 ---------------- .github/workflows/clang-tidy-check.yml | 24 ++++++++++++++++++++ src/Player/Equipment/Shovel/EntityShovel.cpp | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/clang-format-check.yml create mode 100644 .github/workflows/clang-tidy-check.yml diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml deleted file mode 100644 index 1f29b4e0..00000000 --- a/.github/workflows/clang-format-check.yml +++ /dev/null @@ -1,19 +0,0 @@ -# name: clang-format Check -# on: [push, pull_request] -# jobs: -# formatting-check: -# name: Formatting Check -# runs-on: ubuntu-latest -# strategy: -# matrix: -# path: -# - "src" -# - "include" -# steps: -# - uses: actions/checkout@v3 -# - name: Run clang-format style check for C/C++/Protobuf programs. -# uses: jidicula/clang-format-action@v4.11.0 -# with: -# clang-format-version: "18" -# check-path: ${{ matrix.path }} -# fallback-style: "Mozilla" # optional diff --git a/.github/workflows/clang-tidy-check.yml b/.github/workflows/clang-tidy-check.yml new file mode 100644 index 00000000..1ad539bd --- /dev/null +++ b/.github/workflows/clang-tidy-check.yml @@ -0,0 +1,24 @@ +name: clang-tidy-review + +# You can be more specific, but it currently only works on pull requests +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Optionally generate compile_commands.json + + - uses: ZedThree/clang-tidy-review@v0.14.0 + id: review + + # Uploads an artefact containing clang_fixes.json + - uses: ZedThree/clang-tidy-review/upload@v0.14.0 + id: upload-review + + # If there are any comments, fail the check + - if: steps.review.outputs.total_comments > 0 + run: exit 1 diff --git a/src/Player/Equipment/Shovel/EntityShovel.cpp b/src/Player/Equipment/Shovel/EntityShovel.cpp index 2e756a8e..a5e13b5d 100644 --- a/src/Player/Equipment/Shovel/EntityShovel.cpp +++ b/src/Player/Equipment/Shovel/EntityShovel.cpp @@ -4,4 +4,4 @@ #include "Equipment/Shovel/EntityShovel.h" ToolSystem::EntityShovel::EntityShovel() - : TBaseShovel(level, ImagePath, m_IsThrow) {}; + : TBaseShovel(level, ImagePath, m_IsThrow){}; From 0f6bbeccd594127fac05e7fe0ce5e887b3d24b37 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 13:54:32 +0800 Subject: [PATCH 21/26] test --- .github/workflows/clang-tidy-check.yml | 2 +- .github/workflows/main.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang-tidy-check.yml b/.github/workflows/clang-tidy-check.yml index 1ad539bd..50f2bbc0 100644 --- a/.github/workflows/clang-tidy-check.yml +++ b/.github/workflows/clang-tidy-check.yml @@ -1,7 +1,7 @@ name: clang-tidy-review # You can be more specific, but it currently only works on pull requests -on: [push] +on: [pull_request] jobs: build: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb874ba1..6e1f4f9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,8 @@ name: Compile -on: push +on: + merge_group: + pull_request: jobs: build: From 44f78261141dcf89e82a5276c3efb158cde3673f Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 14:11:57 +0800 Subject: [PATCH 22/26] test --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e1f4f9d..67f6f270 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,4 +67,3 @@ jobs: with: clang-format-version: "18" check-path: ${{ matrix.path }} - fallback-style: "Mozilla" # optional From 5cb1ed855c858cde74e964823ec425151739f2a1 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 14:13:43 +0800 Subject: [PATCH 23/26] update --- src/Player/Equipment/Weapon/EntityBroadsword.cpp | 2 +- src/Player/Equipment/Weapon/EntityDagger.cpp | 2 +- src/Player/Equipment/Weapon/EntityRapier.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player/Equipment/Weapon/EntityBroadsword.cpp b/src/Player/Equipment/Weapon/EntityBroadsword.cpp index 3493e953..3ae58ed9 100644 --- a/src/Player/Equipment/Weapon/EntityBroadsword.cpp +++ b/src/Player/Equipment/Weapon/EntityBroadsword.cpp @@ -5,4 +5,4 @@ ToolSystem::EntityBroadsword::EntityBroadsword() : TBaseWeapon(normal, blood, glass, golden, obsidian, titanium, ImagePath, - m_IsThrow) {}; + m_IsThrow){}; diff --git a/src/Player/Equipment/Weapon/EntityDagger.cpp b/src/Player/Equipment/Weapon/EntityDagger.cpp index 558c4797..84708d6e 100644 --- a/src/Player/Equipment/Weapon/EntityDagger.cpp +++ b/src/Player/Equipment/Weapon/EntityDagger.cpp @@ -6,4 +6,4 @@ ToolSystem::EntityDagger::EntityDagger() : TBaseWeapon(normal, blood, glass, golden, obsidian, titanium, ImagePath, - isThrow) {}; + isThrow){}; diff --git a/src/Player/Equipment/Weapon/EntityRapier.cpp b/src/Player/Equipment/Weapon/EntityRapier.cpp index b00479e3..3084bd96 100644 --- a/src/Player/Equipment/Weapon/EntityRapier.cpp +++ b/src/Player/Equipment/Weapon/EntityRapier.cpp @@ -6,4 +6,4 @@ ToolSystem::EntityRapier::EntityRapier() : TBaseWeapon(normal, blood, glass, golden, obsidian, titanium, ImagePath, - isThrow) {}; + isThrow){}; From 9360c2aceae0528720be600ac7a9f01973425898 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 14:20:28 +0800 Subject: [PATCH 24/26] test --- .github/workflows/multi_system.yml | 113 -------------------- include/Player/Equipment/Weapon/Component.h | 4 +- 2 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 .github/workflows/multi_system.yml diff --git a/.github/workflows/multi_system.yml b/.github/workflows/multi_system.yml deleted file mode 100644 index 1d250ec9..00000000 --- a/.github/workflows/multi_system.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: main - -on: - merge_group: - pull_request: - -jobs: - windows-visual-studio: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - name: "Setup Visual Studio" - uses: egor-tensin/vs-shell@v2 - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: "Setup cmake" - - run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug - cmake --build build - - windows-mingw: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: seanmiddleditch/gha-setup-ninja@master - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: "Build" - run: | - cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" - # cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug - cmake --build build - macos: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - - name: "Setup required packages" - run: brew install cmake ninja mesa-glu mesa xorg-server - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Building Project - run: | - cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug - cmake --build build - - linux-clang: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: "Setup required packages" - run: | - sudo apt-get update - sudo apt-get -y install clang cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - - - name: "Setup clang" - uses: egor-tensin/setup-clang@v1 - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Building Project - env: - CC: clang - CXX: clang++ - run: | - cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug - cmake --build build - - linux-gcc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Installing Dependencies - run: | - sudo apt-get update - sudo apt-get -y install gcc cmake ninja-build libglu1-mesa-dev mesa-common-dev xorg-dev - - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Building Project - env: - CC: gcc - CXX: g++ - run: | - cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug - cmake --build build - - # CXX: g++ - # run: | - # cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Debug - # cmake --build build diff --git a/include/Player/Equipment/Weapon/Component.h b/include/Player/Equipment/Weapon/Component.h index 258d069f..fddc29fa 100644 --- a/include/Player/Equipment/Weapon/Component.h +++ b/include/Player/Equipment/Weapon/Component.h @@ -35,7 +35,7 @@ struct Damage { struct Settings { explicit Settings(std::string &path, bool isThrow) : imagePath(path), - isThrow(isThrow) {}; + isThrow(isThrow){}; std::string imagePath; bool isThrow; @@ -48,7 +48,7 @@ struct TBaseWeapon : Damage, Settings { std::string obsidian, int16t titan, std::string path, bool isThrow) : Damage(nor, blood, glass, golden, obsidian, titan), - Settings(path, isThrow) {}; + Settings(path, isThrow){}; }; }; // namespace ToolSystem From 47a130bdef785b8ddb03a8cb02eaa0c288e7f218 Mon Sep 17 00:00:00 2001 From: "@onon1101" <98307453+onon1101@users.noreply.github.com> Date: Sun, 21 Apr 2024 14:23:50 +0800 Subject: [PATCH 25/26] Update SComponent.h --- include/Player/Equipment/Shovel/SComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Player/Equipment/Shovel/SComponent.h b/include/Player/Equipment/Shovel/SComponent.h index ec725a47..5ccead87 100644 --- a/include/Player/Equipment/Shovel/SComponent.h +++ b/include/Player/Equipment/Shovel/SComponent.h @@ -15,7 +15,7 @@ namespace ToolSystem { // Dig Level struct DigLevel { explicit DigLevel(std::vector _level) - : level(_level) {}; + : level(_level){}; std::vector level; }; From 1470707187edc6a90040a9c2be91e7da99a78d74 Mon Sep 17 00:00:00 2001 From: onon1101 Date: Sun, 21 Apr 2024 14:32:29 +0800 Subject: [PATCH 26/26] test --- .github/workflows/clang-tidy-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-check.yml b/.github/workflows/clang-tidy-check.yml index 50f2bbc0..cebb61d8 100644 --- a/.github/workflows/clang-tidy-check.yml +++ b/.github/workflows/clang-tidy-check.yml @@ -1,7 +1,7 @@ name: clang-tidy-review # You can be more specific, but it currently only works on pull requests -on: [pull_request] +on: [ pull_request ] jobs: build: @@ -18,6 +18,8 @@ jobs: # Uploads an artefact containing clang_fixes.json - uses: ZedThree/clang-tidy-review/upload@v0.14.0 id: upload-review + with: + max_comments: 10 # If there are any comments, fail the check - if: steps.review.outputs.total_comments > 0