Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
precompiled.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Wildfire Games.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23/*
24 * precompiled header. must be the first non-comment part of every
25 * source file (VC++ requirement).
26 */
27
28// some libraries have only a small number of source files, and the
29// overhead of including loads of headers here outweighs the improvements to
30// incremental rebuild performance.
31// they can set MINIMAL_PCH to 1 so we include far fewer headers (but
32// still do the global disabling of warnings and include config headers etc),
33// or set it to 2 to remove STL headers too (precompiling STL helps performance
34// in most non-tiny cases)
35#ifndef MINIMAL_PCH
36# define MINIMAL_PCH 0
37#endif
38
39// IWYU pragma: begin_keep
40
41#include "lib/config.h" // CONFIG_ENABLE_PCH
42#include "lib/sysdep/compiler.h" // MSC_VERSION
43
44// must come before any STL headers are included
45#if MSC_VERSION
46# if MSC_VERSION < 1910
47# error "Visual Studio 2017 is the minimal supported version"
48# endif
49# ifdef NDEBUG // release: disable all checks
50# define _HAS_ITERATOR_DEBUGGING 0
51# define _SECURE_SCL 0
52# endif
53#endif
54
55// disable some common and annoying warnings
56// (as soon as possible so that headers below are covered)
58
59
60//
61// headers made available everywhere for convenience
62//
63
64#include "lib/posix/posix_types.h" // (must come before any system headers because it fixes off_t)
65#include "lib/code_annotation.h"
66#include "lib/sysdep/arch.h"
67#include "lib/sysdep/os.h"
68#include "lib/sysdep/stl.h"
69#include "lib/debug.h"
70#include "lib/lib.h"
71#include "lib/secure_crt.h"
72
73#include <array>
74#include <memory>
75
76// (must come after boost and common lib headers, but before re-enabling
77// warnings to avoid boost spew)
78#include "lib/posix/posix.h"
79
80
81//
82// precompiled headers
83//
84
85// if PCHs are supported and enabled, we make an effort to include all
86// system headers. otherwise, only a few central headers (e.g. types)
87// are pulled in and source files must include all the system headers
88// they use. this policy ensures good compile performance whether or not
89// PCHs are being used.
90
91#if CONFIG_ENABLE_PCH
92
93// anything placed here won't need to be compiled in each translation unit,
94// but will cause a complete rebuild if they change.
95
96#include "lib/pch/pch_stdlib.h"
97
98// These two files are included (directly or indirectly) by about half of the .cpp files.
99// Changing these thus forces recompilation of most of the project regardless,
100// and putting them in the precompiled header cuts a large amount of time even even on incremental builds.
101#include "ps/CLogger.h"
102#include "ps/Profile.h"
103
104#endif // #if CONFIG_ENABLE_PCH
105
106// IWYU pragma: end_keep
107