Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
65 lines (63 loc) · 4.21 KB
/
Copy pathDirectory.Build.props
File metadata and controls
65 lines (63 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Project>
<Import Project="$(MSBuildThisFileDirectory)Version.props" />
<Import Project="$(MSBuildThisFileDirectory)build\BuildMetadata.props"
Condition="Exists('$(MSBuildThisFileDirectory)build\BuildMetadata.props')" />
<!--
MSVC 14.38 miscompiles C++20 constructs used by EnTT. Release builders must
provide v143 14.44 or newer; selecting the installed v143 toolset keeps newer
Visual Studio runners usable instead of requiring a VS 2022 installation.
-->
<PropertyGroup>
<!-- Funke vendors its native dependencies; classic vcpkg auto-link can inject duplicate runtimes. -->
<VcpkgEnabled>false</VcpkgEnabled>
<!--
Force the 64-bit hosted cl.exe. The 32-bit compiler is limited to a
~2 GB process heap and runs out during template-heavy translation
units (magic_enum reflection in ComponentInspectors.cpp / inspector
registrations) producing MSVC fatal error C1060 "out of heap space".
The 64-bit host raises that ceiling to the machine's physical memory.
-->
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
<!--
Cap per-compiler parallelism. Projects set flags{"MultiProcessorCompile"}
(/MP), which without a count spawns one cl.exe child per logical core —
24 on a typical dev box here. Each child is an independent heap, and the
editor additionally passes /Zm2000 (max heap reservation), so the product
of /MP width and per-TU peak memory is what historically produced
`fatal error C1060: out of heap space` and, under -m, `C2471` from
concurrent PDB writes. Those failures were nondeterministic: whichever
heavy TUs happened to land in the same batch tipped the machine over.
MSBuild's VC targets map CL_MPCount onto ClCompile/ProcessorNumber
(Microsoft.Cl.Common.props), so setting it here bounds /MP for every
project without touching the premake files. A command-line
-p:CL_MPCount=N is a global property and still overrides this.
Min(12, cores) leaves headroom for the OS, an open Visual Studio and a
browser while still using a 24-core box properly. Lower it if you build
with a lot else resident; raise it on a dedicated machine.
-->
<CL_MPCount Condition="'$(CL_MPCount)' == ''">$([System.Math]::Min(12, $([System.Environment]::ProcessorCount)))</CL_MPCount>
<!--
Without MultiToolTask, every distinct per-file option set (NoPCH, /bigobj,
per-file includedirs) becomes its own sequential cl.exe /MP batch, so the
slowest TUs ended up compiling almost alone at the end of the build.
MultiToolTask schedules each file individually across all option sets.
EnforceProcessCountAcrossBuilds makes MultiProcMaxCount a machine-wide cap
shared by every project in a -m build, which keeps the C1060 heap
headroom described above.
-->
<UseMultiToolTask Condition="'$(UseMultiToolTask)' == ''">true</UseMultiToolTask>
<EnforceProcessCountAcrossBuilds Condition="'$(EnforceProcessCountAcrossBuilds)' == ''">true</EnforceProcessCountAcrossBuilds>
<MultiProcMaxCount Condition="'$(MultiProcMaxCount)' == ''">$(CL_MPCount)</MultiProcMaxCount>
<!--
Visual Studio 18 and 2022 install byte-identical v143 toolsets in different folders. #pragma once
is path-based, so a PCH built by one makes the other's compiles fail (C2375
"__builtin_assume_aligned": redefinition in intrin0.inl.h); the project's .lib then stays stale
and its consumers report LNK2019. Premake writes IntDir as <objdir>$(FunkeIntDirSuffix)\
(premake/compat.lua): VS 2022 (scripts\dev\Build.ps1) keeps bin-int\<cfg>\<project>\, every
other Visual Studio gets its own folder next to it. Outputs in bin\ stay shared.
-->
<FunkeIntDirSuffix Condition="'$(FunkeIntDirSuffix)' == '' and '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' != '17.0'">-vs$(VisualStudioVersion)</FunkeIntDirSuffix>
<InformationalVersion Condition="'$(InformationalVersion)' == ''">$(FunkeVersion)+unknown</InformationalVersion>
<Win32Resource Condition="'$(OS)' == 'Windows_NT' and Exists('$(MSBuildThisFileDirectory)build\ManagedVersion.res')">$(MSBuildThisFileDirectory)build\ManagedVersion.res</Win32Resource>
</PropertyGroup>
</Project>