Make rcu_thread_key context-aware
[openssl.git] / Configurations / 50-win-hybridcrt.conf
1 ## -*- mode: perl; -*-
2 # Windows HybridCRT targets.
3
4 # https://github.com/microsoft/WindowsAppSDK/blob/77761e244289fda6b3d5f14c7bded189fed4fb89/docs/Coding-Guidelines/HybridCRT.md
5 # Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
6 # lib and instead linking against the Universal CRT DLL import library. This "Hybrid" linking mechanism is
7 # supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
8 # than they would otherwise be if the CRT, runtime, and STL were all statically linked in.
9
10
11 sub remove_from_flags {
12     my ($toRemove, $flags) = @_;
13     
14     return $flags =~ s/$toRemove//r;
15 }
16
17 my %targets = (
18     "VC-WIN32-HYBRIDCRT" => {
19         inherit_from    => [ "VC-WIN32" ],
20         cflags          => sub {
21             remove_from_flags(qr/\/MDd?\s/, add(picker(debug   => "/MTd",
22                                                        release => "/MT"))->(@_))
23         },
24         lflags          => add(picker(debug   => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
25                                       release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
26     },
27     "VC-WIN64A-HYBRIDCRT" => {
28         inherit_from    => [ "VC-WIN64A" ],
29         cflags          => sub {
30             remove_from_flags(qr/\/MDd?\s/, add(picker(debug   => "/MTd",
31                                                        release => "/MT"))->(@_))
32         },
33         lflags          => add(picker(debug   => "/NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib",
34                                       release => "/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")),
35     },
36 );