From 0b55a69a4e257ac650adb92c4f099e16a93a4f46 Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Mon, 13 May 2024 14:28:11 +0200 Subject: [PATCH] fix mbedtl building for only older c++ --- build_win_deps.bat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build_win_deps.bat b/build_win_deps.bat index 98e82623..99fd944b 100644 --- a/build_win_deps.bat +++ b/build_win_deps.bat @@ -72,10 +72,13 @@ if %jobs_count% lss 1 ( :: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS_CONFIG.html#variable:CMAKE_%3CLANG%3E_FLAGS_%3CCONFIG%3E set cmake_common_args=-G "Visual Studio 17 2022" -S . set cmake_common_defs=-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_STANDARD_REQUIRED=ON -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_C_STANDARD=17 -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=True -DBUILD_SHARED_LIBS=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded "-DCMAKE_C_FLAGS_RELEASE=/MT /std:c17 /D_MT" "-DCMAKE_CXX_FLAGS_RELEASE=/MT /std:c++17 /D_MT" +set cmake_common_defs_mbedtls=-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_STANDARD_REQUIRED=ON -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_POSITION_INDEPENDENT_CODE=True -DBUILD_SHARED_LIBS=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded "-DCMAKE_C_FLAGS_RELEASE=/MT /D_MT" "-DCMAKE_CXX_FLAGS_RELEASE=/MT /D_MT" set "recreate_32=rmdir /s /q build32\ 1>nul 2>&1 & rmdir /s /q install32\ 1>nul 2>&1 & mkdir build32\ && mkdir install32\" set "recreate_64=rmdir /s /q build64\ 1>nul 2>&1 & rmdir /s /q install64\ 1>nul 2>&1 & mkdir build64\ && mkdir install64\" set cmake_gen32="%mycmake%" %cmake_common_args% -A Win32 -B build32 -DCMAKE_INSTALL_PREFIX=install32 %cmake_common_defs% set cmake_gen64="%mycmake%" %cmake_common_args% -A x64 -B build64 -DCMAKE_INSTALL_PREFIX=install64 %cmake_common_defs% +set cmake_gen32_mbedtls="%mycmake%" %cmake_common_args% -A Win32 -B build32 -DCMAKE_INSTALL_PREFIX=install32 %cmake_common_defs_mbedtls% +set cmake_gen64_mbedtls="%mycmake%" %cmake_common_args% -A x64 -B build64 -DCMAKE_INSTALL_PREFIX=install64 %cmake_common_defs_mbedtls% set cmake_build32="%mycmake%" --build build32 --config Release --parallel %jobs_count% %VERBOSITY% set cmake_build64="%mycmake%" --build build64 --config Release --parallel %jobs_count% %VERBOSITY% set "clean_gen32=if exist build32\ rmdir /s /q build32" @@ -312,7 +315,7 @@ call "%~dp0build_win_set_env.bat" 32 || ( goto :end_script ) %recreate_32% -%cmake_gen32% %mbedtls_common_defs% +%cmake_gen32_mbedtls% %mbedtls_common_defs% set /a _exit=%errorlevel% %cmake_build32% --target install set /a _exit+=%errorlevel% @@ -328,7 +331,7 @@ call "%~dp0build_win_set_env.bat" 64 || ( goto :end_script ) %recreate_64% -%cmake_gen64% %mbedtls_common_defs% +%cmake_gen64_mbedtls% %mbedtls_common_defs% set /a _exit=%errorlevel% %cmake_build64% --target install set /a _exit+=%errorlevel%