Automatically set b_vscrt on Windows

This commit is contained in:
Tamás Bálint Misius
2024-11-07 18:24:26 +01:00
parent b46f35c1e5
commit 809ae3ae93
2 changed files with 9 additions and 8 deletions

12
.github/build.sh vendored
View File

@@ -231,14 +231,10 @@ if [[ $PACKAGE_MODE == backendvs ]]; then
fi fi
if [[ $BSH_STATIC_DYNAMIC == static ]]; then if [[ $BSH_STATIC_DYNAMIC == static ]]; then
meson_configure+=$'\t'-Dstatic=prebuilt meson_configure+=$'\t'-Dstatic=prebuilt
if [[ $BSH_HOST_PLATFORM == windows ]]; then if [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == windows-mingw ]]; then
if [[ $BSH_HOST_LIBC == msvc ]]; then c_link_args+=\'-static\',
meson_configure+=$'\t'-Db_vscrt=static_from_buildtype c_link_args+=\'-static-libgcc\',
else c_link_args+=\'-static-libstdc++\',
c_link_args+=\'-static\',
c_link_args+=\'-static-libgcc\',
c_link_args+=\'-static-libstdc++\',
fi
elif [[ $BSH_HOST_PLATFORM == linux ]]; then elif [[ $BSH_HOST_PLATFORM == linux ]]; then
c_link_args+=\'-static-libgcc\', c_link_args+=\'-static-libgcc\',
c_link_args+=\'-static-libstdc++\', c_link_args+=\'-static-libstdc++\',

View File

@@ -358,6 +358,11 @@ if host_platform == 'windows'
endif endif
endforeach endforeach
endif endif
if tpt_libs_static == 'static' and host_libc == 'msvc'
target_options += [
'b_vscrt=static_from_buildtype',
]
endif
foreach def : defs_ccomp_win foreach def : defs_ccomp_win
if cpp_compiler.get_argument_syntax() == 'msvc' if cpp_compiler.get_argument_syntax() == 'msvc'
args_ccomp_win += [ '/D' + def ] args_ccomp_win += [ '/D' + def ]