From 66878ea2fc0dd05bb978a47110cab8c11dabb9a9 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 13 May 2026 13:22:34 -0700 Subject: [PATCH 1/2] C++17 or later use inline constexpr vars --- Inc/DirectXMath.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Inc/DirectXMath.h b/Inc/DirectXMath.h index 417f34f..a980cb2 100644 --- a/Inc/DirectXMath.h +++ b/Inc/DirectXMath.h @@ -2006,7 +2006,9 @@ namespace DirectX // separate math routine it would be reloaded. #ifndef XMGLOBALCONST -#if defined(__GNUC__) && !defined(__MINGW32__) +#if __cplusplus >= 201703L +#define XMGLOBALCONST inline constexpr +#elif defined(__GNUC__) && !defined(__MINGW32__) #define XMGLOBALCONST extern const __attribute__((weak)) #else #define XMGLOBALCONST extern const __declspec(selectany) From 931b2c8b22554e2e201baaa60ce8f9a0f3ac8613 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 13 May 2026 13:37:07 -0700 Subject: [PATCH 2/2] Additional GHA coverage for C++20 --- .github/workflows/wslcxx.yml | 81 +++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wslcxx.yml b/.github/workflows/wslcxx.yml index c335239..dedbec3 100644 --- a/.github/workflows/wslcxx.yml +++ b/.github/workflows/wslcxx.yml @@ -29,7 +29,7 @@ permissions: contents: read jobs: - build: + buildgcc: runs-on: ubuntu-latest strategy: @@ -108,3 +108,82 @@ jobs: - name: 'Build (C++20)' working-directory: ${{ github.workspace }}/Tests run: cmake --build out/build/${{ matrix.build_type }} + + buildclang: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + build_type: [x64-Debug-Linux, x64-Release-Linux] + clang: [16, 17, 18] + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Clone test repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: walbourn/directxmathtest + path: Tests + ref: main + + - uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6 + + - name: 'Configure CMake (C++17)' + working-directory: ${{ github.workspace }}/Tests + run: cmake --preset=${{ matrix.build_type }} + env: + CC: clang-${{ matrix.clang }} + CXX: clang++-${{ matrix.clang }} + + - name: 'Build (C++17)' + working-directory: ${{ github.workspace }}/Tests + run: cmake --build out/build/${{ matrix.build_type }} + + - name: 'Clean up' + working-directory: ${{ github.workspace }} + run: rm -rf out + + # Test suite requires C++17 features on Linux, so we only test the headers for C++11/C++14 + - name: 'Configure CMake (C++11)' + working-directory: ${{ github.workspace }}/Tests/headertest + run: cmake --preset=${{ matrix.build_type }} -DBUILD_CXX11=ON + env: + CC: clang-${{ matrix.clang }} + CXX: clang++-${{ matrix.clang }} + + - name: 'Build (C++11)' + working-directory: ${{ github.workspace }}/Tests/headertest + run: cmake --build out/build/${{ matrix.build_type }} + + - name: 'Clean up' + working-directory: ${{ github.workspace }}/Tests/headertest + run: rm -rf out + + - name: 'Configure CMake (C++14)' + working-directory: ${{ github.workspace }}/Tests/headertest + run: cmake --preset=${{ matrix.build_type }} -DBUILD_CXX14=ON + env: + CC: clang-${{ matrix.clang }} + CXX: clang++-${{ matrix.clang }} + + - name: 'Build (C++14)' + working-directory: ${{ github.workspace }}/Tests/headertest + run: cmake --build out/build/${{ matrix.build_type }} + + - name: 'Clean up' + working-directory: ${{ github.workspace }}/Tests/headertest + run: rm -rf out + + - name: 'Configure CMake (C++20)' + working-directory: ${{ github.workspace }}/Tests + run: cmake --preset=${{ matrix.build_type }} -DBUILD_CXX20=ON + env: + CC: clang-${{ matrix.clang }} + CXX: clang++-${{ matrix.clang }} + + - name: 'Build (C++20)' + working-directory: ${{ github.workspace }}/Tests + run: cmake --build out/build/${{ matrix.build_type }}