diff --git a/.clang-tidy b/.clang-tidy index e5c0717..390862f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,7 +2,6 @@ Checks: 'cert-*,clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,hicpp-*,google-*,misc-*,modernize-*,performance-*,portability-*,readability-*,bugprone-*,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-google-readability-casting,-clang-analyzer-optin.cplusplus.UninitializedObject,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.NullDereference' WarningsAsErrors: 'cert-*,clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,hicpp-*,google-*,misc-*,modernize-*,performance-*,portability-*,readability-*,bugprone-*,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-google-readability-casting,-clang-analyzer-optin.cplusplus.UninitializedObject,-clang-analyzer-cplusplus.NewDeleteLeaks,-misc-include-cleaner,-clang-analyzer-core.NullDereference' HeaderFilterRegex: '(hyperion)$' -AnalyzeTemporaryDtors: true FormatStyle: none User: braxton UseColor: true diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 66438c0..2575e24 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [12, 13] + version: [12, 13, 14] fail-fast: false steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [15, 16, 17, 18] + version: [16, 17, 18, 19, 20] fail-fast: false steps: - uses: actions/checkout@v4 @@ -60,11 +60,21 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh ${{matrix.version}} - sudo apt-get -y install clang-tidy-${{matrix.version}} + if [[ ${{matrix.version}} == 20 \ + ]]; then + sudo ./llvm.sh ${{matrix.version}} + sudo apt-get install -y clang-tidy-${{matrix.version}} + else + sudo apt-get install -y llvm-${{matrix.version}} clang-${{matrix.version}} clang-tidy-${{matrix.version}} + fi - name: Replace clang-tidy - run: sudo cp /usr/bin/clang-tidy-${{matrix.version}} /usr/bin/clang-tidy -f + run: | + if [[ "$(realpath --canonicalize-existing /usr/bin/clang-tidy-${{matrix.version}})" \ + != "$(realpath --canonicalize-existing /usr/bin/clang-tidy)" \ + ]]; then + sudo cp /usr/bin/clang-tidy-${{matrix.version}} /usr/bin/clang-tidy -f + fi - name: Configure env: @@ -132,7 +142,7 @@ jobs: runs-on: macos-latest strategy: matrix: - version: [15, 16, 17, 18] + version: [16, 17, 18, 19, 20] fail-fast: false steps: - uses: actions/checkout@v4 @@ -141,7 +151,7 @@ jobs: - name: Install LLVM run: | brew install llvm@${{matrix.version}} - echo "PATH=$(brew --prefix llvm@${{matrix.version}})/bin:$PATH" >> $GITHUB_ENV + echo "$(brew --prefix llvm@${{matrix.version}})/bin" >> $GITHUB_PATH echo "CC=$(brew --prefix llvm@${{matrix.version}})/bin/clang" >> $GITHUB_ENV echo "CXX=$(brew --prefix llvm@${{matrix.version}})/bin/clang++" >> $GITHUB_ENV echo "LDFLAGS='-L$(brew --prefix llvm@${{matrix.version}})/lib/c++ -Wl,-rpath,$(brew --prefix llvm@${{matrix.version}})/lib/c++'" >> $GITHUB_ENV diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c772760..7115d5c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,6 +12,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update apt + run: sudo apt-get -y update + - name: Install Doxygen run: sudo apt-get -y install doxygen @@ -19,7 +22,7 @@ jobs: run: sudo apt-get -y install graphviz - name: Install LibGS - run: sudo apt-get -y install libgs9 libgs9-common + run: sudo apt-get -y install libgs10 libgs10-common - name: Install GCC 12 run: sudo apt-get -y install gcc-12 diff --git a/.github/workflows/xmake.yml b/.github/workflows/xmake.yml index 69c31ed..89d0708 100644 --- a/.github/workflows/xmake.yml +++ b/.github/workflows/xmake.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [12, 13] + version: [12, 13, 14] fail-fast: false steps: - uses: actions/checkout@v4 @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [15, 16, 17, 18] + version: [16, 17, 18, 19, 20] fail-fast: false steps: - uses: actions/checkout@v4 @@ -79,11 +79,21 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh ${{matrix.version}} - sudo apt-get -y install clang-tidy-${{matrix.version}} + if [[ ${{matrix.version}} == 20 \ + ]]; then + sudo ./llvm.sh ${{matrix.version}} + sudo apt-get install -y clang-tidy-${{matrix.version}} + else + sudo apt-get install -y llvm-${{matrix.version}} clang-${{matrix.version}} clang-tidy-${{matrix.version}} + fi - name: Replace clang-tidy - run: sudo cp /usr/bin/clang-tidy-${{matrix.version}} /usr/bin/clang-tidy -f + run: | + if [[ "$(realpath --canonicalize-existing /usr/bin/clang-tidy-${{matrix.version}})" \ + != "$(realpath --canonicalize-existing /usr/bin/clang-tidy)" \ + ]]; then + sudo cp /usr/bin/clang-tidy-${{matrix.version}} /usr/bin/clang-tidy -f + fi - name: Configure working-directory: ${{github.workspace}} @@ -143,9 +153,6 @@ jobs: - name: Install XMake run: | scoop install xmake - xmake update -sfy master - Start-Sleep -Seconds 2 - xmake update -fy master - name: Configure working-directory: ${{github.workspace}} @@ -182,7 +189,7 @@ jobs: runs-on: macos-13 strategy: matrix: - version: [15, 16, 17, 18] + version: [16, 17, 18, 19, 20] fail-fast: false steps: - uses: actions/checkout@v4 @@ -196,14 +203,19 @@ jobs: - name: Install LLVM run: | brew install llvm@${{matrix.version}} - echo "PATH=$(brew --prefix llvm@${{matrix.version}})/bin:$PATH" >> $GITHUB_ENV - echo "CC=$(brew --prefix llvm@${{matrix.version}})/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@${{matrix.version}})/bin/clang++" >> $GITHUB_ENV - echo "LDFLAGS='-L$(brew --prefix llvm@${{matrix.version}})/lib/c++ -Wl,-rpath,$(brew --prefix llvm@${{matrix.version}})/lib/c++'" >> $GITHUB_ENV + echo "$(brew --prefix llvm@${{matrix.version}})/bin" + ln -s "$(brew --prefix llvm@${{matrix.version}})/bin/clang++" "$(brew --prefix llvm@${{matrix.version}})/bin/clang++-${{matrix.version}}" + ls "$(brew --prefix llvm@${{matrix.version}})/bin" + echo "$(brew --prefix llvm@${{matrix.version}})/bin" >> $GITHUB_PATH - name: Configure working-directory: ${{github.workspace}} - run: xmake f -c -y --toolchain=clang --hyperion_enable_tracy=y + run: | + xmake show -l toolchains + xmake f -c -y --toolchain=clang-${{matrix.version}} --hyperion_enable_tracy=y + xmake project -k compile_commands + sed -i '' 's/"-I"/"-isystem"/g' compile_commands.json + cat compile_commands.json - name: Build env: @@ -211,7 +223,12 @@ jobs: working-directory: ${{github.workspace}} run: | xmake b - xmake check clang.tidy + # disable clang-tidy on clang 19 and 20 because it is scanning errors + # within standard library headers + if [[ ${{matrix.version}} != 19 && ${{matrix.version}} != 20 \ + ]]; then + xmake check clang.tidy + fi - name: Test env: @@ -230,6 +247,6 @@ jobs: run: | xrepo add-repo -y hyperion "https://github.com/braxtons12/hyperion_packages.git" xrepo update-repo -y - xrepo install -y --toolchain=clang "hyperion_platform ${{ steps.extract_branch.outputs.branch }}" - xrepo install -y --toolchain=clang --configs="hyperion_enable_tracy=true" "hyperion_platform ${{ steps.extract_branch.outputs.branch }}" + xrepo install -y --toolchain=clang-${{matrix.version}} "hyperion_platform ${{ steps.extract_branch.outputs.branch }}" + xrepo install -y --toolchain=clang-${{matrix.version}} --configs="hyperion_enable_tracy=true" "hyperion_platform ${{ steps.extract_branch.outputs.branch }}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 9564aa3..47eb644 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20) -project(hyperion_platform LANGUAGES CXX VERSION 0.5.3) +project(hyperion_platform LANGUAGES CXX VERSION 0.5.4) include(CTest) diff --git a/cmake/hyperion_compiler_settings.cmake b/cmake/hyperion_compiler_settings.cmake index c390b4b..0ec565c 100644 --- a/cmake/hyperion_compiler_settings.cmake +++ b/cmake/hyperion_compiler_settings.cmake @@ -46,7 +46,7 @@ function(hyperion_compile_settings TARGET) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMILER_ID STREQUAL "clang") - target_compile_options(${TARGET} ${PUBLIC_VISIBILITY} -fsized-deallocation) + target_compile_options(${TARGET} ${PUBLIC_VISIBILITY} -fsized-deallocation -ferror-limit=0) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMILER_ID STREQUAL "clang") diff --git a/src/test_main.cpp b/src/test_main.cpp index 4bcaadc..9214eba 100644 --- a/src/test_main.cpp +++ b/src/test_main.cpp @@ -1,8 +1,8 @@ /// @file test_main.cpp /// @author Braxton Salyer /// @brief Unit tests main for hyperion::platform. -/// @version 0.1 -/// @date 2024-09-22 +/// @version 0.1.1 +/// @date 2025-07-09 /// /// MIT License /// @copyright Copyright (c) 2024 Braxton Salyer @@ -25,6 +25,7 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE /// SOFTWARE. +#include #include #include diff --git a/xmake.lua b/xmake.lua index 1f1088f..66b658c 100644 --- a/xmake.lua +++ b/xmake.lua @@ -1,8 +1,8 @@ ---@diagnostic disable: undefined-global,undefined-field set_project("hyperion_platform") -set_version("0.5.3") +set_version("0.5.4") -set_xmakever("2.8.7") +set_xmakever("3.0.0") set_languages("cxx20") diff --git a/xmake/hyperion_compiler_settings.lua b/xmake/hyperion_compiler_settings.lua index 7aa604b..ab47546 100644 --- a/xmake/hyperion_compiler_settings.lua +++ b/xmake/hyperion_compiler_settings.lua @@ -15,7 +15,12 @@ end local function _set_compile_options(target) if is_mode("release") then - target:set("optimize", "aggressive") + if target:has_tool("cxx", "clang", "clang++") then + -- clang 19 deprecates -Ofast, so just use -O3 on clang + target:set("optimize", "fastest") + else + target:set("optimize", "aggressive") + end if target:has_tool("cxx", "cl") then -- do not enable avx512 on MSVC is it has an optimizer error -- that will cause a crash due to misalignment @@ -50,6 +55,7 @@ local function _set_compile_options(target) target:add("cxflags", "/sdl", { public = false }) elseif target:has_tool("cxx", "clang", "clang++") then target:add("cxflags", "-fsized-deallocation", { public = true }) + target:add("cxflags", "-ferror-limit=0", { public = true }) end end