diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22c31d4..1726e44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,6 @@ jobs: uses: lukka/run-cmake@v10 with: cmakeListsTxtPath: '${{ github.workspace }}/server/Native/CMakeLists.txt' - configurePreset: ninja-multi-vcpkg buildPreset: ninja-multi-vcpkg buildPresetAdditionalArgs: '[`--config Release`]' - name: List $RUNNER_WORKSPACE after build diff --git a/server/Dockerfile b/server/Dockerfile index 40a55c5..8b19bf9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -7,6 +7,7 @@ ADD protocol /workspace/protocol # generate and build RUN vcpkg install --triplet=x64-linux RUN sed -i 's\../../shared/protocol\protocol\g' /workspace/CMakeLists.txt +# TODO: Use CMakePresets instead. RUN cmake -DCMAKE_TOOLCHAIN_FILE:STRING=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug \ -H/workspace -B/workspace/build -G Ninja diff --git a/server/Native/CMakePresets.json b/server/Native/CMakePresets.json new file mode 100644 index 0000000..e291add --- /dev/null +++ b/server/Native/CMakePresets.json @@ -0,0 +1,37 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "ninja-vcpkg", + "displayName": "Ninja Configure Settings", + "description": "Configure with vcpkg toolchain", + "binaryDir": "${sourceDir}/build/${presetName}", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + } + } + } + ], + "buildPresets": [ + { + "name": "ninja-vcpkg", + "configurePreset": "ninja-vcpkg", + "displayName": "Build ninja-vcpkg", + "description": "Build ninja-vcpkg Configurations" + } + ], + "testPresets": [ + { + "name": "ninja-vcpkg", + "configurePreset": "ninja-vcpkg" + } + ] + } \ No newline at end of file