IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
config.hxx
Go to the documentation of this file.
1
3
4#pragma once
5#include <ice/types.hxx>
6#include <string_view>
7
8namespace ice::build
9{
10
18
19 constexpr auto to_string(Configuration type) noexcept -> std::string_view;
20
21
22#if defined ICE_DEBUG
23
24 static constexpr Configuration current_config = Configuration::Debug;
25
26#undef ICE_DEBUG
27#define ICE_DEBUG 1
28#define ICE_DEVELOP 0
29#define ICE_PROFILE 0
30#define ICE_RELEASE 0
31
32#elif defined ICE_DEVELOP
33
34 static constexpr Configuration current_config = Configuration::Develop;
35
36#undef ICE_DEVELOP
37#define ICE_DEBUG 0
38#define ICE_DEVELOP 1
39#define ICE_PROFILE 0
40#define ICE_RELEASE 0
41
42#elif defined ICE_PROFILE
43
44 static constexpr Configuration current_config = Configuration::Profile;
45
46#undef ICE_PROFILE
47#define ICE_DEBUG 0
48#define ICE_DEVELOP 0
49#define ICE_PROFILE 1
50#define ICE_RELEASE 0
51
52#elif defined ICE_RELEASE
53
54 static constexpr Configuration current_config = Configuration::Release;
55
56#undef ICE_RELEASE
57#define ICE_DEBUG 0
58#define ICE_DEVELOP 0
59#define ICE_PROFILE 0
60#define ICE_RELEASE 1
61
62#else
63
64 static_assert(false, "Unknown configuration!");
65
66#endif
67
68
69 constexpr auto to_string(Configuration type) noexcept -> std::string_view
70 {
71 switch (type)
72 {
74 return "Debug";
76 return "Develop";
78 return "Profile";
80 return "Release";
81 default:
82 return "<invalid>";
83 }
84 }
85
86} // namespace ice::build
Definition build.hxx:12
constexpr auto to_string(Configuration type) noexcept -> std::string_view
Definition config.hxx:69
Configuration
Definition config.hxx:12
@ Develop
Definition config.hxx:14
@ Debug
Definition config.hxx:13
@ Release
Definition config.hxx:16
@ Profile
Definition config.hxx:15
std::uint8_t u8
Definition types.hxx:24