From 4fff85fb1e78f8872dde514648ba75114a7a93b5 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Mon, 15 May 2023 20:35:17 +0200 Subject: [PATCH 1/2] added MinGW configuration in CMakePreset and example pipeline --- .github/workflows/build_cmake.yml | 36 ++++++++++++++++++++ CMakePresets.json | 56 +++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 5174c5e..1a107b9 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -235,3 +235,39 @@ jobs: - name: Build shell: bash run: cmake --build --preset build-unixlike-${{ matrix.compiler.preset }}-${{ matrix.buildtype }} + + windows-mingw: + name: ${{ matrix.os }}, MinGW ${{ matrix.buildtype }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix entry fails. + matrix: + os: [windows-2022] + buildtype: [debug] + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: make + - name: Install conan + run: | + pacman --noconfirm -S mingw-w64-x86_64-ninja + pacman --noconfirm -S mingw-w64-x86_64-gcc + pacman --noconfirm -S mingw-w64-x86_64-cmake + pacman --noconfirm -S mingw-w64-x86_64-python + pacman --noconfirm -S mingw-w64-x86_64-python-pip + python3 -m pip install --upgrade pip setuptools + python3 -m pip install conan==1.58 + + - name: Configure CMake + run: cmake --preset win32-gcc-x64-mingw-${{ matrix.buildtype }} + + - name: Build + run: cmake --build --preset build-win32-gcc-x64-mingw-${{ matrix.buildtype }} + + - name: Test + run: ctest --preset test-win32-gcc-x64-mingw-${{ matrix.buildtype }} diff --git a/CMakePresets.json b/CMakePresets.json index cfc579a..f01bf11 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -402,6 +402,44 @@ "CMAKE_C_COMPILER": "clang-15", "CMAKE_CXX_COMPILER": "clang++-15" } + }, + { + "name": "win32-gcc-x64-mingw-debug", + "displayName": "Windows GCC x64 (MinGW Makefiles) Debug", + "description": "Using GCC x64 compiler with Ninja generator on Windows - Debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/debug/${presetName}", + "installDir": "${sourceDir}/install/${presetName}", + "environment": { + "PATH": "C:/msys64/mingw64/bin;$penv{PATH}" + }, + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc.exe", + "CMAKE_CXX_COMPILER": "g++.exe", + "CMAKE_BUILD_TYPE": "Debug", + "CPP_STARTER_USE_SML": "ON", + "CPP_STARTER_USE_BOOST_BEAST": "ON", + "CPP_STARTER_USE_CROW": "ON" + } + }, + { + "name": "win32-gcc-x64-mingw-release", + "displayName": "Windows GCC x64 (MinGW Makefiles) Release", + "description": "Using GCC x64 compiler with Ninja generator on Windows - Release", + "generator": "Ninja", + "installDir": "${sourceDir}/install/${presetName}", + "binaryDir": "${sourceDir}/build/release/${presetName}", + "environment": { + "PATH": "C:/msys64/mingw64/bin;$penv{PATH}" + }, + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc.exe", + "CMAKE_CXX_COMPILER": "g++.exe", + "CMAKE_BUILD_TYPE": "Release", + "CPP_STARTER_USE_SML": "ON", + "CPP_STARTER_USE_BOOST_BEAST": "ON", + "CPP_STARTER_USE_CROW": "ON" + } } ], "buildPresets": [ @@ -512,6 +550,14 @@ { "name": "build-clang-15-fuzzing", "configurePreset": "clang-15-fuzzing" + }, + { + "name": "build-win32-gcc-x64-mingw-debug", + "configurePreset": "win32-gcc-x64-mingw-debug" + }, + { + "name": "build-win32-gcc-x64-mingw-release", + "configurePreset": "win32-gcc-x64-mingw-release" } ], "testPresets": [ @@ -708,6 +754,16 @@ "description": "Enable output and stop on failure", "inherits": "test-common", "configurePreset": "clang-15-fuzzing" + }, + { + "name": "test-win32-gcc-x64-mingw-debug", + "configurePreset": "win32-gcc-x64-mingw-debug", + "configuration": "Debug" + }, + { + "name": "test-win32-gcc-x64-mingw-release", + "configurePreset": "win32-gcc-x64-mingw-release", + "configuration": "Release" } ] } From b3783e267c9d7098aa64e4ace0a611139a3eebf5 Mon Sep 17 00:00:00 2001 From: Stephan Kantelberg Date: Mon, 15 May 2023 20:48:10 +0200 Subject: [PATCH 2/2] removed duplicates --- CMakePresets.json | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index f01bf11..cfc579a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -402,44 +402,6 @@ "CMAKE_C_COMPILER": "clang-15", "CMAKE_CXX_COMPILER": "clang++-15" } - }, - { - "name": "win32-gcc-x64-mingw-debug", - "displayName": "Windows GCC x64 (MinGW Makefiles) Debug", - "description": "Using GCC x64 compiler with Ninja generator on Windows - Debug", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/debug/${presetName}", - "installDir": "${sourceDir}/install/${presetName}", - "environment": { - "PATH": "C:/msys64/mingw64/bin;$penv{PATH}" - }, - "cacheVariables": { - "CMAKE_C_COMPILER": "gcc.exe", - "CMAKE_CXX_COMPILER": "g++.exe", - "CMAKE_BUILD_TYPE": "Debug", - "CPP_STARTER_USE_SML": "ON", - "CPP_STARTER_USE_BOOST_BEAST": "ON", - "CPP_STARTER_USE_CROW": "ON" - } - }, - { - "name": "win32-gcc-x64-mingw-release", - "displayName": "Windows GCC x64 (MinGW Makefiles) Release", - "description": "Using GCC x64 compiler with Ninja generator on Windows - Release", - "generator": "Ninja", - "installDir": "${sourceDir}/install/${presetName}", - "binaryDir": "${sourceDir}/build/release/${presetName}", - "environment": { - "PATH": "C:/msys64/mingw64/bin;$penv{PATH}" - }, - "cacheVariables": { - "CMAKE_C_COMPILER": "gcc.exe", - "CMAKE_CXX_COMPILER": "g++.exe", - "CMAKE_BUILD_TYPE": "Release", - "CPP_STARTER_USE_SML": "ON", - "CPP_STARTER_USE_BOOST_BEAST": "ON", - "CPP_STARTER_USE_CROW": "ON" - } } ], "buildPresets": [ @@ -550,14 +512,6 @@ { "name": "build-clang-15-fuzzing", "configurePreset": "clang-15-fuzzing" - }, - { - "name": "build-win32-gcc-x64-mingw-debug", - "configurePreset": "win32-gcc-x64-mingw-debug" - }, - { - "name": "build-win32-gcc-x64-mingw-release", - "configurePreset": "win32-gcc-x64-mingw-release" } ], "testPresets": [ @@ -754,16 +708,6 @@ "description": "Enable output and stop on failure", "inherits": "test-common", "configurePreset": "clang-15-fuzzing" - }, - { - "name": "test-win32-gcc-x64-mingw-debug", - "configurePreset": "win32-gcc-x64-mingw-debug", - "configuration": "Debug" - }, - { - "name": "test-win32-gcc-x64-mingw-release", - "configurePreset": "win32-gcc-x64-mingw-release", - "configuration": "Release" } ] }