diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml new file mode 100644 index 000000000..a396722c1 --- /dev/null +++ b/.github/workflows/mingw.yml @@ -0,0 +1,54 @@ +name: MinGW Clang64 Full Pipeline + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + strategy: + fail-fast: false + matrix: + profile: [RelWithDebInfo, Debug] + + name: MinGW Clang64 Build (${{ matrix.profile }}) + runs-on: windows-2025 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + + - name: Setup MSYS2 + id: msys2 + uses: msys2/setup-msys2@v2 + with: + msystem: clang64 + update: true + install: >- + git + mingw-w64-clang-x86_64-toolchain + mingw-w64-clang-x86_64-cmake + mingw-w64-clang-x86_64-ninja + + - name: Configure + run: > + cmake -GNinja + -B${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{ matrix.profile }} + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_C_COMPILER=clang + + - name: Build + run: > + cmake + --build ${{github.workspace}}/build + --parallel + + - name: Test + run: | + cd ${{github.workspace}}/build + ctest + diff --git a/CMakeLists.txt b/CMakeLists.txt index cad25ef65..cc8bfdf10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,9 +381,10 @@ function(add_warning_flags name) $<$:/Zi /W4 /WX /wd4127 /wd4324 /wd4201> $<$,$>>:-fno-rtti -Wall -Wextra -Werror -Wundef> $<$:-Wsign-conversion -Wconversion>) + target_link_options(${name} PRIVATE $<$:-Wl,--no-undefined> - $<$:$<${ci_or_debug}:/DEBUG>>) + $<$:$<${ci_or_debug}:LINKER:/DEBUG>>) endfunction() # To build with just the header library target define SNMALLOC_HEADER_ONLY_LIBRARY