From fc583e7101557c55054840bdcc2eba9bbe3ec3b9 Mon Sep 17 00:00:00 2001 From: Ludvig Michaelsson Date: Fri, 1 Sep 2023 11:34:48 +0200 Subject: [PATCH] xxx --- windows/build.ps1 | 1 + windows/const.ps1 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/windows/build.ps1 b/windows/build.ps1 index 52a1d669..01d6e5dd 100644 --- a/windows/build.ps1 +++ b/windows/build.ps1 @@ -183,6 +183,7 @@ try { -DBUILD_SHARED_LIBS="${SHARED}" ` -DCMAKE_C_FLAGS_DEBUG="${CFLAGS_DEBUG}" ` -DCMAKE_C_FLAGS_RELEASE="${CFLAGS_RELEASE}" ` + -DCMAKE_MSVC_RUNTIME_LIBRARY="${CMAKE_MSVC_RUNTIME_LIBRARY}" -DCMAKE_INSTALL_PREFIX="${PREFIX}" "${CMAKE_SYSTEM_VERSION}"; ` ExitOnError & $CMake --build . --config ${Config} --verbose; ExitOnError diff --git a/windows/const.ps1 b/windows/const.ps1 index 41092268..3e847a57 100644 --- a/windows/const.ps1 +++ b/windows/const.ps1 @@ -30,13 +30,19 @@ New-Variable -Name 'OUTPUT' -Value "$PSScriptRoot\..\output" -Option Constant New-Variable -Name 'STAGE' -Value "${BUILD}\${Arch}\${Type}" -Option Constant New-Variable -Name 'PREFIX' -Value "${OUTPUT}\${Arch}\${Type}" -Option Constant +New-Varible '_RUNTIME_DYNAMIC' -Value '$<$:DLL>' -Option Constant +New-Variable '_RUNTIME_CONFIG' -Value '<$<$CONFIG:Debug>:Debug>' -Option Constant +New-Variable 'CMAKE_MSVC_RUNTIME_LIBRARY' -Value "MultiThreaded${_RUNTIME_CONFIG}${_RUNTIME_DYNAMIC}" -Option Constant + # Build flags. if ("${Type}" -eq "dynamic") { New-Variable -Name 'RUNTIME' -Value '/MD' -Option Constant New-Variable -Name 'SHARED' -Value 'ON' -Option Constant + New-Variable -Name 'CMAKE_RUNTIME' -Value 'MultiThreaded<$<$CONFIG:Debug>:Debug>DLL' } else { New-Variable -Name 'RUNTIME' -Value '/MT' -Option Constant New-Variable -Name 'SHARED' -Value 'OFF' -Option Constant + New-Variable -Name 'CMAKE_RUNTIME' -Value 'MultiThreaded<$<$CONFIG:Debug>:Debug>' } New-Variable -Name 'CFLAGS_DEBUG' -Value "${RUNTIME}d /Zi /guard:cf /sdl" ` -Option Constant