This repository was archived by the owner on Mar 24, 2025. It is now read-only.
forked from fastbuild/fastbuild
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFBuildOptions.h
108 lines (89 loc) · 4.03 KB
/
FBuildOptions.h
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// FBuild.cpp - The main FBuild interface class
//------------------------------------------------------------------------------
#pragma once
// Includes
//------------------------------------------------------------------------------
// FBuild
#include "Tools/FBuild/FBuildCore/Protocol/Protocol.h"
// Core
#include "Core/Env/Types.h"
#include "Core/Strings/AString.h"
// FBuildOptions
//------------------------------------------------------------------------------
struct FBuildOptions
{
public:
FBuildOptions();
enum OptionsResult
{
OPTIONS_OK,
OPTIONS_OK_AND_QUIT,
OPTIONS_ERROR
};
OptionsResult ProcessCommandLine( int argc, char * argv[] );
enum WrapperMode
{
WRAPPER_MODE_NONE,
WRAPPER_MODE_MAIN_PROCESS,
WRAPPER_MODE_INTERMEDIATE_PROCESS,
WRAPPER_MODE_FINAL_PROCESS
};
void SetWorkingDir( const AString & path );
inline const AString & GetWorkingDir() const { return m_WorkingDir; }
const AString& GetArgs() const { return m_Args; }
// Basic Args
AString m_ProgramName;
AString m_Args; // Stored copy of args
WrapperMode m_WrapperMode = WRAPPER_MODE_NONE;
// Targets
Array< AString > m_Targets;
// Build Behaviour
bool m_ForceCleanBuild = false;
bool m_StopOnFirstError = true;
bool m_FastCancel = false;
bool m_WaitMode = false;
bool m_DisplayTargetList = false;
bool m_DisplayDependencyDB = false;
bool m_NoUnity = false;
// Cache
bool m_UseCacheRead = false;
bool m_UseCacheWrite = false;
bool m_CacheInfo = false;
bool m_CacheVerbose = false;
uint32_t m_CacheTrim = 0;
// Distributed Compilation
bool m_AllowDistributed = false;
bool m_DistVerbose = false;
bool m_NoLocalConsumptionOfRemoteJobs = false;
bool m_AllowLocalRace = true;
uint16_t m_DistributionPort = Protocol::PROTOCOL_PORT;
// General Output
bool m_ShowInfo = false;
bool m_ShowCommandLines = false;
bool m_ShowBuildCommands = true;
bool m_ShowErrors = true;
bool m_ShowProgress = false;
bool m_ShowSummary = false;
bool m_NoSummaryOnError = false;
bool m_GenerateReport = false;
bool m_EnableMonitor = false;
// DB loading/saving
bool m_SaveDBOnCompletion = false;
bool m_FixupErrorPaths = false;
bool m_ForceDBMigration_Debug = false; // Force migration even if bff has not changed (for tests)
uint32_t m_NumWorkerThreads = 0; // True default detected in constructor
AString m_ConfigFile;
inline uint32_t GetWorkingDirHash() const { return m_WorkingDirHash; }
inline const AString & GetMainProcessMutexName() const { return m_ProcessMutexName; }
inline const AString & GetFinalProcessMutexName( ) const { return m_FinalProcessMutexName; }
inline const AString & GetSharedMemoryName() const { return m_SharedMemoryName; }
private:
void DisplayHelp( const AString & programName ) const;
void DisplayVersion() const;
AString m_WorkingDir;
uint32_t m_WorkingDirHash = 0;
AString m_ProcessMutexName;
AString m_FinalProcessMutexName;
AString m_SharedMemoryName;
};
//------------------------------------------------------------------------------