From 1f3a730d0ae619486f848b29da9b09bfee197b36 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Sat, 11 Mar 2023 21:48:31 +0100 Subject: [PATCH 1/3] .gitignore: do not count Visual Studio user settings --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5f95d32f..c00f4b74 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .cproject .project .settings/ +.vs/ Makefile /src/bin/* !/src/bin/hamcore/ From 96ab9691521b7352b4c13b347dfe9ec9cd2850d9 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Sat, 11 Mar 2023 21:52:11 +0100 Subject: [PATCH 2/3] build: windows: link MSVC runtime statically --- CMakeLists.txt | 7 +++++++ CMakeSettings.json | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06204010..3ededd63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,13 @@ if (BUILD_NUMBER LESS 5180) "For detailed info: https://github.com/SoftEtherVPN/SoftEtherVPN/issues/1392#issuecomment-867348281") endif() +# +# Link MSVC runtime statically +# this should be revisited after installer migration to MSI +# +cmake_policy(SET CMP0091 NEW) +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + project("SoftEther VPN" VERSION "5.02.${BUILD_NUMBER}" LANGUAGES C diff --git a/CMakeSettings.json b/CMakeSettings.json index 77a121fd..fa46663d 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -30,7 +30,7 @@ }, { "name": "VCPKG_TARGET_TRIPLET", - "value": "x64-windows-static-md", + "value": "x64-windows-static", "type": "STRING" } ] @@ -64,7 +64,7 @@ }, { "name": "VCPKG_TARGET_TRIPLET", - "value": "x86-windows-static-md", + "value": "x86-windows-static", "type": "STRING" } ] @@ -98,7 +98,7 @@ }, { "name": "VCPKG_TARGET_TRIPLET", - "value": "x64-windows-static-md", + "value": "x64-windows-static", "type": "STRING" } ] @@ -132,7 +132,7 @@ }, { "name": "VCPKG_TARGET_TRIPLET", - "value": "x86-windows-static-md", + "value": "x86-windows-static", "type": "STRING" } ] From 0ff9d1a455b792c440ac808f972ff358275bb755 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Sat, 11 Mar 2023 23:08:59 +0100 Subject: [PATCH 3/3] CI: Windows: use static link for MSVC runtime --- .ci/azure-pipelines/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/azure-pipelines/windows.yml b/.ci/azure-pipelines/windows.yml index 8137a44f..6c6a75e8 100644 --- a/.ci/azure-pipelines/windows.yml +++ b/.ci/azure-pipelines/windows.yml @@ -10,7 +10,7 @@ jobs: parameters: architecture: "x64" compilerPath: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe" - vcpkgTriplet: "x64-windows-static-md" + vcpkgTriplet: "x64-windows-static" vcvarsPath: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" - job: Windows_x86 pool: @@ -23,5 +23,5 @@ jobs: parameters: architecture: "x86" compilerPath: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/bin/clang-cl.exe" - vcpkgTriplet: "x86-windows-static-md" + vcpkgTriplet: "x86-windows-static" vcvarsPath: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat"