Skip to content

Commit 898d5a6

Browse files
Updating SDL Window and documentations
1 parent dd3a2ec commit 898d5a6

File tree

4 files changed

+35
-43
lines changed

4 files changed

+35
-43
lines changed

Examples/SDLWindow.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
SearchLibraryNames: ["SDL2"]
1515
ExcludeLibraryNames: ["SDL2-static", "SDL2_test"] # On Windows
1616
SearchDirectories: ["./build", "./build/debug"]
17-
Setup: ["mkdir build", "cd build && cmake .."]
18-
Build: ["cd build && cmake --build . -j 16"]
17+
Setup: ["mkdir build", "cd build && cmake .. && cmake --build . -j 16"]
1918
2019
# Or use system installed SDL on Unix...
2120
# OverrideLinkFlags:

mkdocs/docs/TODO.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## Done
55

66
### Nightly
7+
- Add version for default user config and prompt for update
78

89
### v0.3.1
910
- Check last run is shared lib or executable. Reset cache when necessary if different type
@@ -27,12 +28,10 @@
2728
## Planned
2829

2930
### v0.4.0
30-
3131
- Allow runcpp2 to be library for scriptable pipeline
32-
- Add version for default user config and prompt for update
3332
- Add more default profiles
3433
- Migrate to libyaml
35-
- Ability to compile runcpp2 as single cpp
34+
- Ability to compile runcpp2 as single cpp, to ditch cmake
3635

3736
## High Priority
3837

mkdocs/docs/guides/building_project_sources.md

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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

185180
You 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

204199
1. **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
```

mkdocs/docs/guides/external_dependencies.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ These paths are relative to the dependency's root directory:
103103

104104
### Link Settings
105105

106-
For non-header libraries, you need to specify how to link against the library using `LinkProperties`:
106+
For non-header libraries, you need to specify how to link against the library using `LinkProperties`
107+
which can be configured per platform/profile:
107108

108109
???+ example
109110
```yaml
@@ -195,16 +196,16 @@ to your executable. You can specify these files using the `FilesToCopy` field.
195196
All paths are relative to the dependency's root directory.
196197
The files are copied to the output directory where the executable is located.
197198

199+
This can be configured per platform/profile.
200+
198201
???+ example
199202
```yaml
200203
Dependencies:
201204
- Name: MyLibraryA
202205
# ... other fields ...
203206
FilesToCopy:
204-
DefaultPlatform:
205-
DefaultProfile:
206-
- "assets/shaders/default.glsl" # Copy shader file
207-
- "data/config.json" # Copy config file
207+
- "assets/shaders/default.glsl" # Copy shader file
208+
- "data/config.json" # Copy config file
208209
- Name: MyLibraryB
209210
# ... other fields ...
210211
FilesToCopy:

0 commit comments

Comments
 (0)