-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildType.hpp
More file actions
64 lines (57 loc) · 1.96 KB
/
Copy pathBuildType.hpp
File metadata and controls
64 lines (57 loc) · 1.96 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
#ifndef RUNCPP2_DATA_BUILD_TYPE_HPP
#define RUNCPP2_DATA_BUILD_TYPE_HPP
#include <string>
namespace runcpp2
{
namespace Data
{
enum class BuildType
{
EXECUTABLE,
STATIC,
SHARED,
OBJECTS,
INTERNAL_EXECUTABLE_EXECUTABLE,
INTERNAL_EXECUTABLE_SHARED,
COUNT
};
inline std::string BuildTypeToString(BuildType buildType)
{
static_assert(static_cast<int>(BuildType::COUNT) == 6, "Add new type to be processed");
switch(buildType)
{
case BuildType::EXECUTABLE:
return "Executable";
case BuildType::STATIC:
return "Static";
case BuildType::SHARED:
return "Shared";
case BuildType::OBJECTS:
return "Objects";
case BuildType::INTERNAL_EXECUTABLE_EXECUTABLE:
return "InternalExecutable";
case BuildType::INTERNAL_EXECUTABLE_SHARED:
return "InternalExecutableShared";
default:
return "";
}
}
inline BuildType StringToBuildType(const std::string& buildTypeStr)
{
if(buildTypeStr == "Executable")
return BuildType::EXECUTABLE;
else if(buildTypeStr == "Static")
return BuildType::STATIC;
else if(buildTypeStr == "Shared")
return BuildType::SHARED;
else if(buildTypeStr == "Objects")
return BuildType::OBJECTS;
else if(buildTypeStr == "InternalExecutable")
return BuildType::INTERNAL_EXECUTABLE_EXECUTABLE;
else if(buildTypeStr == "InternalExecutableShared")
return BuildType::INTERNAL_EXECUTABLE_SHARED;
return BuildType::COUNT;
}
}
}
#endif