diff --git a/.github/workflows/build-client.yml b/.github/workflows/build-client.yml index a0d770c5bb..e97de31313 100644 --- a/.github/workflows/build-client.yml +++ b/.github/workflows/build-client.yml @@ -29,17 +29,19 @@ jobs: - macos-11 include: - os: windows-2022 - cmake_options: -DWITH_DRIVER_DIRECT3D=ON -DWITH_DRIVER_XAUDIO2=ON + cmake_preset: windows-client - os: windows-2019 - cmake_options: -DWITH_DRIVER_DIRECT3D=ON -DWITH_DRIVER_XAUDIO2=ON + cmake_preset: windows-client - os: ubuntu-22.04 ubuntu_version: 22.04 + cmake_preset: linux-client - os: ubuntu-20.04 ubuntu_version: 20.04 + cmake_preset: linux-client - os: macos-14 - cmake_options: -DWITH_LIBXML2_ICONV=OFF -GXcode + cmake_preset: macos-client - os: macos-11 - cmake_options: -DWITH_LIBXML2_ICONV=OFF -GXcode + cmake_preset: macos-client steps: - uses: actions/checkout@v4 @@ -98,25 +100,11 @@ jobs: - name: Configure CMake run: > - cmake --version; - cmake -B ${{ steps.strings.outputs.build-output-dir }} - ${{ matrix.cmake_options }} - -DCMAKE_CONFIGURATION_TYPES=Release - -DFINAL_VERSION=OFF + cmake --preset ${{ matrix.cmake_preset }} -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_ENABLED=ON -DHUNTER_ROOT=${{ steps.strings.outputs.hunter-dir }} - -DWITH_DRIVER_OPENAL=ON - -DWITH_DRIVER_OPENGL=ON - -DWITH_INSTALL_LIBRARIES=OFF - -DWITH_NEL_SAMPLES=OFF - -DWITH_NEL_TESTS=OFF - -DWITH_NEL_TOOLS=OFF - -DWITH_RYZOM_CLIENT=ON - -DWITH_RYZOM_SERVER=OFF - -DWITH_RYZOM_TOOLS=OFF -S ${{ github.workspace }} - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release + run: cmake --build --preset client diff --git a/CMakePresets.json b/CMakePresets.json index 6e6208a353..cc95d7175e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -4,13 +4,39 @@ { "name": "base", "hidden": true, - "generator": "Ninja Multi-Config", "binaryDir": "${sourceDir}/build" }, { - "inherits": [ - "base" - ], + "name": "linux", + "inherits": "base", + "generator": "Ninja Multi-Config", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "windows", + "inherits": "base", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "macos", + "inherits": "base", + "generator": "Xcode", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "inherits": "base", "name": "default", "cacheVariables": { "WITH_STATIC": true, @@ -41,6 +67,50 @@ "CMAKE_C_FLAGS": "--coverage", "CMAKE_CXX_FLAGS": "--coverage" } + }, + { + "inherits": "base", + "name": "client", + "cacheVariables": { + "FINAL_VERSION": false, + "WITH_DRIVER_OPENAL": true, + "WITH_DRIVER_OPENGL": true, + "WITH_INSTALL_LIBRARIES": false, + "WITH_NEL_SAMPLES": false, + "WITH_NEL_TESTS": false, + "WITH_NEL_TOOLS": false, + "WITH_RYZOM_CLIENT": true, + "WITH_RYZOM_SERVER": false, + "WITH_RYZOM_TOOLS": false + } + }, + { + "inherits": [ + "linux", + "client" + ], + "name": "linux-client" + }, + { + "inherits": [ + "windows", + "client" + ], + "name": "windows-client", + "cacheVariables": { + "WITH_DRIVER_DIRECT3D": true, + "WITH_DRIVER_XAUDIO2": true + } + }, + { + "inherits": [ + "macos", + "client" + ], + "name": "macos-client", + "cacheVariables": { + "WITH_LIBXML2_ICONV": false + } } ], "buildPresets": [ @@ -53,6 +123,11 @@ "name": "release", "configurePreset": "default", "configuration": "Release" + }, + { + "name": "client", + "configurePreset": "client", + "configuration": "Release" } ], "testPresets": [