1
2
3
4
5
6 #ifndef CMAJOR_SYMBOLS_GLOBAL_FLAGS_INCLUDED
7 #define CMAJOR_SYMBOLS_GLOBAL_FLAGS_INCLUDED
8 #include <cmajor/symbols/SymbolsApi.hpp>
9 #include <string>
10 #include <vector>
11 #include <stdint.h>
12 #include <set>
13
14 namespace cmajor { namespace symbols {
15
16 enum class GlobalFlags : uint64_t
17 {
18 none= 0,
19 verbose= 1 << 0,
20 quiet= 1 << 1,
21 release= 1 << 2,
22 clean= 1 << 3,
23 debugParsing= 1 << 4,
24 emitLlvm= 1 << 5,
25 emitOptLlvm= 1 << 6,
26 linkWithDebugRuntime= 1 << 7,
27 linkUsingMsLink= 1 << 8,
28 ide= 1 << 9,
29 strictNothrow= 1 << 10,
30 time= 1 << 11,
31 info= 1 << 12,
32 unitTest= 1 << 13,
33 profile= 1 << 14,
34 generateDebugInfo= 1 << 15,
35 msbuild= 1 << 16,
36 ast2xml= 1 << 17,
37 sym2xml= 1 << 18,
38 bdt2xml= 1 << 19,
39 cmdoc= 1 << 20,
40 optimizeCmDoc= 1 << 21,
41 singleThreadedCompile= 1 << 22,
42 debugCompile= 1 << 23,
43 rebuild= 1 << 24,
44 disableCodeGen= 1 << 25,
45 disableSystem= 1 << 26,
46 justMyCodeDebugging= 1 << 27,
47 buildAll= 1 << 28,
48 printDebugMessages= 1 << 29,
49 repository= 1 << 30,
50 updateSourceFileModuleMap= 1ll << 31,
51 trace= 1ll << 32
52 };
53
54 enum class BackEnd : int
55 {
56 llvm= 0, cmsx= 1, cmcpp= 2
57 };
58
59 void SetBackEnd(BackEnd backend_);
60 BackEnd GetBackEnd();
61
62 void ResetGlobalFlags();
63 void SetGlobalFlag(GlobalFlags flag);
64 void ResetGlobalFlag(GlobalFlags flag);
65 bool GetGlobalFlag(GlobalFlags flag);
66
67 std::string GetConfig();
68 int GetOptimizationLevel();
69 void SetOptimizationLevel(int optimizationLevel_);
70 int GetNumBuildThreads();
71 void SetNumBuildThreads(int numBuildThreads_);
72
73 void SetCompilerVersion(const std::string& compilerVersion_);
74 std::string GetCompilerVersion();
75
76 void DefineCommandLineConditionalSymbol(const std::u32string& symbol);
77 std::set<std::u32string> GetCommandLineDefines();
78
79 bool BeginUnitTest();
80 bool InUnitTest();
81 void ResetUnitTestAssertionNumber();
82 int32_t GetNextUnitTestAssertionNumber();
83 int32_t GetNumUnitTestAssertions();
84 void EndUnitTest(bool prevUnitTest);
85 void SetAssertionLineNumberVector(std::std::vector<int32_t>*assertionLineNumberVector_);
86 void AddAssertionLineNumber(int32_t lineNumber);
87
88 } }
89
90 #endif // CMAJOR_SYMBOLS_GLOBAL_FLAGS_INCLUDED