From 809ae3ae93f4231cbe49681d1dcb8994f08e5016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Thu, 7 Nov 2024 18:24:26 +0100 Subject: [PATCH] Automatically set b_vscrt on Windows --- .github/build.sh | 12 ++++-------- meson.build | 5 +++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/build.sh b/.github/build.sh index dbfef9d2c..b93d8e1fe 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -231,14 +231,10 @@ if [[ $PACKAGE_MODE == backendvs ]]; then fi if [[ $BSH_STATIC_DYNAMIC == static ]]; then meson_configure+=$'\t'-Dstatic=prebuilt - if [[ $BSH_HOST_PLATFORM == windows ]]; then - if [[ $BSH_HOST_LIBC == msvc ]]; then - meson_configure+=$'\t'-Db_vscrt=static_from_buildtype - else - c_link_args+=\'-static\', - c_link_args+=\'-static-libgcc\', - c_link_args+=\'-static-libstdc++\', - fi + if [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == windows-mingw ]]; then + c_link_args+=\'-static\', + c_link_args+=\'-static-libgcc\', + c_link_args+=\'-static-libstdc++\', elif [[ $BSH_HOST_PLATFORM == linux ]]; then c_link_args+=\'-static-libgcc\', c_link_args+=\'-static-libstdc++\', diff --git a/meson.build b/meson.build index 38b48a676..0411511c7 100644 --- a/meson.build +++ b/meson.build @@ -358,6 +358,11 @@ if host_platform == 'windows' endif endforeach endif + if tpt_libs_static == 'static' and host_libc == 'msvc' + target_options += [ + 'b_vscrt=static_from_buildtype', + ] + endif foreach def : defs_ccomp_win if cpp_compiler.get_argument_syntax() == 'msvc' args_ccomp_win += [ '/D' + def ]