mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
d30695ba4d
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22019)
38 lines
1.7 KiB
Perl
38 lines
1.7 KiB
Perl
## -*- mode: perl; -*-
|
|
# Windows HybridCRT targets.
|
|
#
|
|
# https://github.com/microsoft/WindowsAppSDK/blob/77761e244289fda6b3d5f14c7bded189fed4fb89/docs/Coding-Guidelines/HybridCRT.md
|
|
# Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
|
|
# lib and instead linking against the Universal CRT DLL import library. This "Hybrid" linking mechanism is
|
|
# supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
|
|
# than they would otherwise be if the CRT, runtime, and STL were all statically linked in.
|
|
|
|
|
|
sub remove_from_flags {
|
|
my ($toRemove, $flags) = @_;
|
|
|
|
$flags =~ s/$toRemove//;
|
|
return $flags;
|
|
}
|
|
|
|
my %targets = (
|
|
"VC-WIN32-HYBRIDCRT" => {
|
|
inherit_from => [ "VC-WIN32" ],
|
|
cflags => sub {
|
|
remove_from_flags(qr/\/MDd?\s/, add(picker(debug => "/MTd",
|
|
release => "/MT"))->(@_))
|
|
},
|
|
lflags => add(picker(debug => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
|
|
release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
|
|
},
|
|
"VC-WIN64A-HYBRIDCRT" => {
|
|
inherit_from => [ "VC-WIN64A" ],
|
|
cflags => sub {
|
|
remove_from_flags(qr/\/MDd?\s/, add(picker(debug => "/MTd",
|
|
release => "/MT"))->(@_))
|
|
},
|
|
lflags => add(picker(debug => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
|
|
release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
|
|
},
|
|
);
|