@@ -89,18 +89,14 @@ All paths are relative to the script file's location.
8989
9090 ```yaml title="Build Settings"
9191 OtherFilesToBeCompiled:
92- DefaultPlatform:
93- DefaultProfile:
94- - "./src/utils.cpp"
95- - "./src/helper.cpp"
92+ - "./src/utils.cpp"
93+ - "./src/helper.cpp"
9694 IncludePaths:
97- DefaultPlatform:
98- DefaultProfile:
99- - "./include"
95+ - "./include"
10096 ```
10197
10298!!! note
103- You can specify different source files for different platforms/profiles:
99+ You can specify different source files for different platforms/profiles, same for IncludePaths :
104100 ```yaml
105101 OtherFilesToBeCompiled:
106102 Windows:
@@ -109,6 +105,13 @@ All paths are relative to the script file's location.
109105 Unix:
110106 "g++":
111107 - "./src/unix_impl.cpp"
108+ IncludePaths:
109+ Windows:
110+ "msvc":
111+ - "./include/win/msvc"
112+ Unix:
113+ "g++":
114+ - "./include/unix/gcc"
112115 ```
113116
114117### Globbing Source Files
@@ -146,13 +149,9 @@ When building a project with a mixture of c and c++ files, the same profile will
146149 RequiredProfiles:
147150 DefaultPlatform: ["gcc"]
148151 OtherFilesToBeCompiled:
149- DefaultPlatform:
150- DefaultProfile:
151- - "./math.c"
152+ - "./math.c"
152153 IncludePaths:
153- DefaultPlatform:
154- DefaultProfile:
155- - "../include"
154+ - "../include"
156155 */
157156 #include "utils.h"
158157 int add(int a, int b) { return a + b; }
@@ -168,38 +167,34 @@ When building a project with a mixture of c and c++ files, the same profile will
168167 IncludePaths:
169168 - "./include"
170169 Build:
171- DefaultPlatform:
172- DefaultProfile:
173- - "runcpp2 -b ./utils.c"
170+ - "runcpp2 -b ./utils.c"
174171 LinkProperties:
175- DefaultPlatform:
176- DefaultProfile:
177- SearchLibraryNames: ["utils"]
178- SearchDirectories: ["./"]
172+ SearchLibraryNames: ["utils"]
173+ SearchDirectories: ["./"]
179174 ```
180175
181176---
182177
183178## Adding Defines
184179
185180You can add preprocessor definitions using the ` Defines ` setting. Defines can be specified with or
186- without values:
181+ without values, for different platforms/profiles :
187182
188183???+ example
189184 ```yaml
185+ # For DefaultPlatform & DefaultProfile
190186 Defines:
191- DefaultPlatform:
192- DefaultProfile:
193- - "DEBUG" # Define without value (#define DEBUG)
194- - "VERSION_MAJOR=1" # Define with value (#define VERSION_MAJOR 1)
195- - "APP_NAME=\" MyApp\" " # Define with string value (#define APP_NAME "MyApp")
187+ - "DEBUG" # Define without value (#define DEBUG)
188+ - "VERSION_MAJOR=1" # Define with value (#define VERSION_MAJOR 1)
189+ - "APP_NAME=\" MyApp\" " # Define with string value (#define APP_NAME "MyApp")
196190 ```
197191
198192---
199193
200194## Adding Command Hooks
201195
202- runcpp2 provides four types of command hooks that run at different stages of the build:
196+ runcpp2 provides four types of command hooks that run at different stages of the build, all of which
197+ can be configured per platform/profile:
203198
2041991 . ** Setup** : Run once before the script is first built
205200 - Runs at the script's location when no build directory exists
@@ -226,17 +221,15 @@ runcpp2 provides four types of command hooks that run at different stages of the
226221 - "mkdir assets"
227222
228223 PreBuild:
229- DefaultPlatform:
230- DefaultProfile:
231- - "python generate_version.py" # Generate version header
224+ - "python generate_version.py" # Generate version header
232225
233226 PostBuild:
234- DefaultPlatform :
227+ Unix :
235228 DefaultProfile:
236229 - "cp -r assets/* ." # Copy assets to output
237230
238231 Cleanup:
239- DefaultPlatform :
232+ Unix :
240233 DefaultProfile:
241234 - "rm -rf assets" # Clean up generated files
242235 ```
0 commit comments