@@ -6,6 +6,10 @@ Templates:
66 " g++_CompileRunParts " : &g++_CompileRunParts
77 - Type : Once
88 CommandPart : " {Executable} -c {CompileFlags}"
9+ - Type : Repeats
10+ CommandPart : " -D{DefineNameOnly}="
11+ - Type : Repeats
12+ CommandPart : " \" -D{DefineName}={DefineValue}\" "
913 - Type : Repeats
1014 CommandPart : " -I\" {IncludeDirectoryPath}\" "
1115 - Type : Once
@@ -20,6 +24,10 @@ Templates:
2024 " vs2022_v17+_CompileRunParts " : &vs2022_v17+_CompileRunParts
2125 - Type : Once
2226 CommandPart : " {Executable} /c {CompileFlags}"
27+ - Type : Repeats
28+ CommandPart : " /D{DefineNameOnly}="
29+ - Type : Repeats
30+ CommandPart : " \" /D{DefineName}={DefineValue}\" "
2331 - Type : Repeats
2432 CommandPart : " /I\" {IncludeDirectoryPath}\" "
2533 - Type : Once
@@ -37,15 +45,15 @@ Templates:
3745
3846 # TODO: Add support for custom platform
3947 # Each of the platform dependent settings can be listed under
40- # - All
48+ # - Default
4149 # - Windows
4250 # - Linux
4351 # - MacOS
4452 # - Unix
4553 FilesTypes : &CommonFilesTypes
4654 ObjectLinkFile :
4755 Prefix :
48- All : " "
56+ Default : " "
4957 Extension :
5058 Windows : " .obj"
5159 Unix : " .o"
@@ -91,6 +99,10 @@ Templates:
9199 Windows : " "
92100 Unix : " "
93101
102+ # WARNING: All command substitutions in this file are passed directly to the shell.
103+ # Exercise caution when using variables or user-provided input in your build commands
104+ # to prevent potential security vulnerabilities.
105+
94106# A profile to be used if not specified while running the build script
95107PreferredProfile : " g++"
96108
@@ -111,12 +123,12 @@ Profiles:
111123 # (Optional) The commands to run in **shell** before calling the compiler/linker for each platform.
112124 # This is run inside the .runcpp2 directory where the build happens.
113125 # Setup:
114- # All : []
126+ # Default : []
115127
116128 # (Optional) The commands to run in **shell** after calling the compiler/linker for each platform.
117129 # This is run inside the .runcpp2 directory where the build happens.
118130 # Cleanup:
119- # All : []
131+ # Default : []
120132
121133 # The file properties for the object files for each platform.
122134 FilesTypes : *CommonFilesTypes
@@ -126,16 +138,19 @@ Profiles:
126138 # (Optional) The command to run together before running each compile command
127139 # in **shell** for each platform
128140 # PreRun:
129- # All : ""
141+ # Default : ""
130142
131143 # Shell command to use for checking if the executable exists or not
132144 CheckExistence :
133- All : " g++ -v"
145+ Default : " g++ -v"
134146
135147 # Here are a list of substitution strings for RunParts, Setup and Cleanup
136148 # {Executable}: Compiler executable
137149 # {CompileFlags}: Compile flags from config and override
138150 # {IncludeDirectoryPath}: Path to include directories for both the script and dependencies
151+ # {DefineNameOnly}: Name of a macro to be defined without a value (equivalent to #define X)
152+ # {DefineName}: Name of a macro to be defined with a value
153+ # {DefineValue}: Value of a macro to be defined (used with {DefineName})
139154
140155 # {InputFileName}: Name of the input file (without directory path and extension)
141156 # {InputFileExtension}: Extension of the input file
@@ -148,7 +163,7 @@ Profiles:
148163 # {OutputFilePath}: (Similar to previous)
149164 CompileTypes :
150165 Executable :
151- All :
166+ Default :
152167 Flags : " -std=c++17 -Wall -Werror"
153168 Executable : " g++"
154169 RunParts : *g++_CompileRunParts
@@ -159,14 +174,14 @@ Profiles:
159174 # This is run inside the .runcpp2 directory where the build happens.
160175 # Cleanup: []
161176 Static :
162- All :
177+ Default :
163178 Flags : " -std=c++17 -Wall -Werror"
164179 Executable : " g++"
165180 RunParts : *g++_CompileRunParts
166181 # Setup: []
167182 # Cleanup: []
168183 Shared :
169- All :
184+ Default :
170185 Flags : " -std=c++17 -Wall -Werror -fpic"
171186 Executable : " g++"
172187 RunParts : *g++_CompileRunParts
@@ -178,11 +193,11 @@ Profiles:
178193 # (Optional) The command to run together before running each link command
179194 # in **shell** for each platform
180195 # PreRun:
181- # All : ""
196+ # Default : ""
182197
183198 # Shell command to use for checking if the executable exists or not
184199 CheckExistence :
185- All : " g++ -v"
200+ Default : " g++ -v"
186201
187202 # Here are a list of substitution strings for RunParts, Setup and Cleanup
188203 # {Executable}: Linker executable
@@ -227,7 +242,7 @@ Profiles:
227242 # Setup: []
228243 # Cleanup: []
229244 Static :
230- All :
245+ Default :
231246 Flags : " "
232247 Executable : " g++"
233248 RunParts : *g++_LinkRunParts
0 commit comments