Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 59e02e5
  • /
  • Configurations
  • /
  • 50-win-hybridcrt.conf
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:242583c72817166df3b640397048fa6aea4bfd42
directory badge Iframe embedding
swh:1:dir:d041d1223fd2e0ca1bd8cdc760fc70f674959a8e
50-win-hybridcrt.conf
## -*- 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")),
    },
);

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top