From ab3c42b75e0ce86fd5476027fbf4c7215d617b7e Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Tue, 29 Aug 2023 11:22:37 +0300 Subject: [PATCH] CMake: remove CMAKE_BUILD_TYPE from configure presets Since we use Visual Studio as generator, CMAKE_BUILD_TYPE doesn't make sense, since configuration (release/debug) is specified on build step, not configure step. Signed-off-by: Lev Stipakov --- .github/workflows/msbuild.yml | 6 +-- CMakeLists.txt | 6 --- CMakePresets.json | 92 ++++++++--------------------------- 3 files changed, 24 insertions(+), 80 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 2cace9a..e766bad 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -54,15 +54,15 @@ jobs: - name: Run CMake consuming CMakePreset.json and vcpkg.json by mean of vcpkg. uses: lukka/run-cmake@v10 with: - configurePreset: '${{ matrix.arch }}-release${{ matrix.ovpn3.preset }}' + configurePreset: '${{ matrix.arch }}${{ matrix.ovpn3.preset }}' buildPreset: '${{ matrix.arch }}-release${{ matrix.ovpn3.preset }}' - uses: actions/upload-artifact@v3 with: name: openvpn-gui_${{ matrix.arch }}${{ matrix.ovpn3.upload_name }} path: | - out/build/${{ matrix.arch }}-release${{ matrix.ovpn3.preset }}/*.dll - out/build/${{ matrix.arch }}-release${{ matrix.ovpn3.preset }}/*.exe + out/build/${{ matrix.arch }}${{ matrix.ovpn3.preset }}/Release/*.dll + out/build/${{ matrix.arch }}${{ matrix.ovpn3.preset }}/Release/*.exe mingw: strategy: diff --git a/CMakeLists.txt b/CMakeLists.txt index 73ebb54..a686c3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,12 +153,6 @@ target_compile_definitions(${TEST_PLAP_EXE} PRIVATE HAVE_CONFIG_H) if(MSVC) - # work around msvc generator Debug/Release directory ugliness, doesn't apply for Ninja - set_target_properties(${PROJECT_NAME} ${PROJECT_NAME_PLAP} ${TEST_PLAP_EXE} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<0:> - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<0:> - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<0:>) - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:/Zi>") target_link_options(${PROJECT_NAME} PRIVATE "$<$:/DEBUG:FULL>" diff --git a/CMakePresets.json b/CMakePresets.json index 65f3494..8654f08 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -16,39 +16,25 @@ }, { "name": "x64", - "hidden": true, + "inherits": "base", "architecture": { "value": "x64" } }, { "name": "arm64", - "hidden": true, + "inherits": "base", "architecture": { "value": "arm64" } }, { "name": "x86", - "hidden": true, + "inherits": "base", "architecture": { "value": "Win32" } }, - { - "name": "debug", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "release", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, { "name": "ovpn3", "hidden": true, @@ -57,113 +43,77 @@ } }, { - "name": "x64-debug", - "inherits": [ "base", "x64", "debug" ] + "name": "x64-ovpn3", + "inherits": [ "x64", "ovpn3" ] }, { - "name": "arm64-debug", - "inherits": [ "base", "arm64", "debug" ] + "name": "arm64-ovpn3", + "inherits": [ "arm64", "ovpn3" ] }, { - "name": "x86-debug", - "inherits": [ "base", "x86", "debug" ] - }, - { - "name": "x64-release", - "inherits": [ "base", "x64", "release" ] - }, - { - "name": "arm64-release", - "inherits": [ "base", "arm64", "release" ] - }, - { - "name": "x86-release", - "inherits": [ "base", "x86", "release" ] - }, - { - "name": "x64-debug-ovpn3", - "inherits": [ "x64-debug", "ovpn3" ] - }, - { - "name": "arm64-debug-ovpn3", - "inherits": [ "arm64-debug", "ovpn3" ] - }, - { - "name": "x86-debug-ovpn3", - "inherits": [ "x86-debug", "ovpn3" ] - }, - { - "name": "x64-release-ovpn3", - "inherits": [ "x64-release", "ovpn3" ] - }, - { - "name": "arm64-release-ovpn3", - "inherits": [ "arm64-release", "ovpn3" ] - }, - { - "name": "x86-release-ovpn3", - "inherits": [ "x86-release", "ovpn3" ] + "name": "x86-ovpn3", + "inherits": [ "x86", "ovpn3" ] } ], "buildPresets": [ { "name": "x64-release", - "configurePreset": "x64-release", + "configurePreset": "x64", "configuration": "Release" }, { "name": "x86-release", - "configurePreset": "x86-release", + "configurePreset": "x86", "configuration": "Release" }, { "name": "arm64-release", - "configurePreset": "arm64-release", + "configurePreset": "arm64", "configuration": "Release" }, { "name": "x64-debug", - "configurePreset": "x64-debug", + "configurePreset": "x64", "configuration": "Debug" }, { "name": "x86-debug", - "configurePreset": "x86-debug", + "configurePreset": "x86", "configuration": "Debug" }, { "name": "arm64-debug", - "configurePreset": "arm64-debug", + "configurePreset": "arm64", "configuration": "Debug" }, { "name": "x64-release-ovpn3", - "configurePreset": "x64-release-ovpn3", + "configurePreset": "x64-ovpn3", "configuration": "Release" }, { "name": "x86-release-ovpn3", - "configurePreset": "x86-release-ovpn3", + "configurePreset": "x86-ovpn3", "configuration": "Release" }, { "name": "arm64-release-ovpn3", - "configurePreset": "arm64-release-ovpn3", + "configurePreset": "arm64-ovpn3", "configuration": "Release" }, { "name": "x64-debug-ovpn3", - "configurePreset": "x64-debug-ovpn3", + "configurePreset": "x64-ovpn3", "configuration": "Debug" }, { "name": "x86-debug-ovpn3", - "configurePreset": "x86-debug-ovpn3", + "configurePreset": "x86-ovpn3", "configuration": "Debug" }, { "name": "arm64-debug-ovpn3", - "configurePreset": "arm64-debug-ovpn3", + "configurePreset": "arm64-ovpn3", "configuration": "Debug" } ]