IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
core
public
ice
build
config.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/types.hxx
>
6
#include <string_view>
7
8
namespace
ice::build
9
{
10
11
enum class
Configuration
:
ice::u8
12
{
13
Debug
,
14
Develop
,
15
Profile
,
16
Release
,
17
};
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
{
73
case
Configuration::Debug
:
74
return
"Debug"
;
75
case
Configuration::Develop
:
76
return
"Develop"
;
77
case
Configuration::Profile
:
78
return
"Profile"
;
79
case
Configuration::Release
:
80
return
"Release"
;
81
default
:
82
return
"<invalid>"
;
83
}
84
}
85
86
}
// namespace ice::build
ice::build
Definition
build.hxx:12
ice::build::to_string
constexpr auto to_string(Configuration type) noexcept -> std::string_view
Definition
config.hxx:69
ice::build::Configuration
Configuration
Definition
config.hxx:12
ice::build::Configuration::Develop
@ Develop
Definition
config.hxx:14
ice::build::Configuration::Debug
@ Debug
Definition
config.hxx:13
ice::build::Configuration::Release
@ Release
Definition
config.hxx:16
ice::build::Configuration::Profile
@ Profile
Definition
config.hxx:15
ice::u8
std::uint8_t u8
Definition
types.hxx:24
types.hxx
Generated by
1.18.0