Skip to content

Commit 8afaddd

Browse files
Updating documentations
1 parent 11c42db commit 8afaddd

File tree

5 files changed

+87
-100
lines changed

5 files changed

+87
-100
lines changed

mkdocs/docs/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
- Add branch/tag option for git
88
- Add initialize submodule option for git
99
- Async/Multi-thread compile and dependencies processing
10+
- Ability to skip DefaultPlatform and DefaultProfile
1011

1112

1213
## Planned
1314

1415
### v0.3.0
1516

16-
- Ability to skip DefaultPlatform and DefaultProfile
1717
- Allow runcpp2 to be library for scriptable pipeline
1818
- Add ability to reference local YAML for user config
1919
- Add version for default user config and prompt for update

mkdocs/docs/build_settings.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,34 @@
250250
- Type: `Platforms Map With Profiles Map`
251251
- Description: A map of platforms with a map of profiles.
252252

253-
??? TODO
254-
If platform and profile are not specified, the default platform and profile are used.
255-
256253
???+ Example
257254
```yaml
258-
Windows:
259-
"g++":
260-
ExampleSetting: "ExampleValue"
261-
Linux:
262-
"g++":
263-
ExampleSetting: "ExampleValue"
264-
MacOS:
265-
"g++":
266-
ExampleSetting: "ExampleValue"
255+
ExampleSettings:
256+
Windows:
257+
"g++":
258+
ExampleSubSetting: "ExampleValue"
259+
Linux:
260+
"g++":
261+
ExampleSubSetting: "ExampleValue2"
262+
MacOS:
263+
"g++":
264+
ExampleSubSetting: "ExampleValue3"
265+
```
266+
267+
!!! info "This requires `latest` version"
268+
If platform and profile are not specified, the default platform and profile are used. So
269+
```yaml
270+
ExampleSettings:
271+
ExampleSubSetting: "ExampleValue"
272+
```
273+
274+
is the same as
275+
276+
```yaml
277+
ExampleSettings:
278+
DefaultPlatform:
279+
DefaultProfile:
280+
ExampleSubSetting: "ExampleValue"
267281
```
268282

269283
### `platform profile list`

mkdocs/docs/guides/basic_concepts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ There are two special keywords for more flexible configuration:
9696
"g++":
9797
Flags: "-O2"
9898
```
99-
When using g++, only `-O2` will be used.
100-
When using any other profile, only `-Wall` will be used, not `-Wall -O2`.
99+
When using g++, only `-O2` will be used, not `-Wall -O2`.
100+
When using any other profile, only `-Wall` will be used.
101101

102-
??? TODO
102+
!!! info "This requires `latest` version"
103103
If you have a setting that **only** has DefaultPlatform and DefaultProfile, you can directly
104104
specify the settings without listing it under DefaultPlatform and DefaultProfile.
105105

mkdocs/docs/guides/building_project_sources.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,6 @@ Each setting supports two operations:
5353
The default flags for each profile can be found in your user config file.
5454
Run `runcpp2 --show-config-path` to locate it.
5555

56-
??? example "Common Use Cases"
57-
```yaml
58-
OverrideCompileFlags:
59-
DefaultPlatform:
60-
"g++":
61-
Append: "-O3" # Optimize for speed
62-
"msvc":
63-
Append: "/O2" # Optimize for speed
64-
65-
OverrideLinkFlags:
66-
Windows:
67-
"msvc":
68-
Append: "/SUBSYSTEM:WINDOWS" # Build as GUI application
69-
```
70-
7156
---
7257

7358
## Adding Source Files And Include Paths

mkdocs/docs/guides/external_dependencies.md

Lines changed: 57 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ This is configured under the `Source` section. We currently support 2 sources:
3535
Source:
3636
Git:
3737
URL: "https://github.com/MyUser/MyLibrary.git"
38-
3938
LibraryType: Static
4039
IncludePaths:
4140
- "include/MyLibrary"
@@ -61,33 +60,35 @@ This is configured under the `Source` section. We currently support 2 sources:
6160

6261
!!! info "This requires `latest` version"
6362

64-
You can specify the target branch/tag name and to clone whole git history or not with:
65-
`Branch` and `FullHistory`.
63+
You can specify the target branch/tag name and to clone whole git history or not with:
64+
`Branch` and `FullHistory`.
6665

67-
You can also specify if you want to clone all the submodules full history or not with `SubmoduleInitType`
66+
You can also specify if you want to clone all the submodules full history or not with
67+
`SubmoduleInitType`
6868

69-
A normal clone without full history will be performed if none of these are specified.
69+
A normal clone without full history will be performed if none of these are specified.
7070

71-
???+ example "Example "Not using default and cloning a specify branch and submodules with full history""
72-
```yaml
73-
Dependencies:
74-
...
75-
Source:
76-
Git:
77-
URL: "https://github.com/MyUser/MyLibrary.git"
78-
Branch: "SpecialBranch"
79-
FullHistory: true
80-
SubmoduleInitType: "Full"
81-
...
82-
```
71+
???+ example "Example "Not using default and cloning a specify branch and submodules with full history""
72+
```yaml
73+
Dependencies:
74+
...
75+
Source:
76+
Git:
77+
URL: "https://github.com/MyUser/MyLibrary.git"
78+
Branch: "SpecialBranch"
79+
FullHistory: true
80+
SubmoduleInitType: "Full"
81+
...
82+
```
8383

8484
---
8585

8686
## Adding Include Paths And Link Settings
8787

8888
### Include Paths
8989

90-
Include paths can be specified using the `IncludePaths` field. These paths are relative to the dependency's root directory:
90+
Include paths can be specified using the `IncludePaths` field.
91+
These paths are relative to the dependency's root directory:
9192

9293
???+ example
9394
```yaml
@@ -104,22 +105,7 @@ Include paths can be specified using the `IncludePaths` field. These paths are r
104105

105106
For non-header libraries, you need to specify how to link against the library using `LinkProperties`:
106107

107-
???+ example "Basic Link Settings"
108-
```yaml
109-
Dependencies:
110-
- Name: MyLibrary
111-
LibraryType: Static
112-
LinkProperties:
113-
DefaultPlatform:
114-
"g++":
115-
# Names to search for when looking for library files
116-
SearchLibraryNames: ["MyLibrary"]
117-
# Where to look for the library files
118-
SearchDirectories: ["build"]
119-
# ... other fields ...
120-
```
121-
122-
??? example "Platform-Specific Link Settings"
108+
???+ example
123109
```yaml
124110
Dependencies:
125111
- Name: MyLibrary
@@ -146,7 +132,8 @@ For non-header libraries, you need to specify how to link against the library us
146132

147133
### Excluding Libraries
148134

149-
Sometimes a dependency might have multiple library files, but you only want to link against specific ones.
135+
Sometimes a dependency might have multiple library files,
136+
but you only want to link against specific ones.
150137

151138
Use `ExcludeLibraryNames` to skip certain libraries:
152139

@@ -169,9 +156,12 @@ Use `ExcludeLibraryNames` to skip certain libraries:
169156

170157
## Adding Setup, Build and Cleanup Commands
171158

172-
runcpp2 supports external dependencies with any build systems by allowing you to specify different command hooks similar to [command hooks in your project](building_project_sources.md#adding-command-hooks)
159+
runcpp2 supports external dependencies with any build systems by allowing you
160+
to specify different command hooks similar to
161+
[command hooks in your project](building_project_sources.md#adding-command-hooks)
173162

174-
The only difference is that `PreBuild` and `PostBuild` hooks are replaced with `Build` hook which is run together when building your project source files.
163+
The only difference is that `PreBuild` and `PostBuild` hooks are replaced with
164+
`Build` hook which is run together when building your project source files.
175165

176166
??? example
177167
```yaml
@@ -196,26 +186,23 @@ The only difference is that `PreBuild` and `PostBuild` hooks are replaced with `
196186

197187
## Copying Files
198188

199-
Sometimes dependencies need additional files (like DLLs, shaders, or assets) to be copied next to your executable. You can specify these files using the `FilesToCopy` field.
189+
Sometimes dependencies need additional files (like DLLs, shaders, or assets) to be copied next
190+
to your executable. You can specify these files using the `FilesToCopy` field.
200191

201-
All paths are relative to the dependency's root directory. The files are copied to the output directory where the executable is located.
192+
All paths are relative to the dependency's root directory.
193+
The files are copied to the output directory where the executable is located.
202194

203-
???+ example "Basic File Copying"
195+
???+ example
204196
```yaml
205197
Dependencies:
206-
- Name: MyLibrary
198+
- Name: MyLibraryA
207199
# ... other fields ...
208200
FilesToCopy:
209201
DefaultPlatform:
210202
DefaultProfile:
211203
- "assets/shaders/default.glsl" # Copy shader file
212204
- "data/config.json" # Copy config file
213-
```
214-
215-
??? example "Copying Platform-Specific Files"
216-
```yaml
217-
Dependencies:
218-
- Name: MyLibrary
205+
- Name: MyLibraryB
219206
# ... other fields ...
220207
FilesToCopy:
221208
Windows:
@@ -230,23 +217,26 @@ All paths are relative to the dependency's root directory. The files are copied
230217

231218
## Importing Dependency Info
232219

233-
You can separate dependency info into standalone YAML files and import them into your project.
220+
You can separate dependency info into standalone dependency YAML files and
221+
import them into your project.
234222

235-
The standalone YAML file is the same as a single dependency entry in the `Dependencies` section.
223+
The standalone dependency YAML file is the same as a single dependency entry in the `Dependencies` section.
236224

237-
??? example
225+
???+ example
238226
If you have:
239-
```yaml
227+
```yaml title="main.yaml"
228+
# ... other fields ...
240229
Dependencies:
241230
- Name: MyLibrary
242231
Platforms: [Windows, Linux, MacOS]
243232
Source:
244233
Git:
245234
URL: "https://github.com/MyUser/MyLibrary.git"
246235
LibraryType: Header
236+
# ... other fields ...
247237
```
248-
Then you can create a standalone YAML file:
249-
```yaml
238+
Then the standalone dependency YAML file will look like this:
239+
```yaml title="MyLibrary.yaml"
250240
Name: MyLibrary
251241
Platforms: [Windows, Linux, MacOS]
252242
Source:
@@ -255,7 +245,7 @@ The standalone YAML file is the same as a single dependency entry in the `Depend
255245
LibraryType: Header
256246
```
257247

258-
To import a dependency info, use the `ImportPath` field under the `Source` section:
248+
To import a standalone dependency YAML, use the `ImportPath` field under the `Source` section:
259249

260250
Just like previously, you can import the dependency info from a git repository or a local directory.
261251

@@ -308,18 +298,16 @@ When using `ImportPath`:
308298
Path: "./libs/LocalLibrary"
309299
```
310300

311-
312-
313-
Example of a dependency configuration file (dependency.yaml):
314-
```yaml
315-
Name: ImportedLibrary
316-
Platforms: [Windows, Linux, MacOS]
317-
LibraryType: Static
318-
IncludePaths:
319-
- "src/include"
320-
Build:
321-
DefaultPlatform:
322-
"g++":
323-
- "cmake -B build"
324-
- "cmake --build build"
325-
```
301+
???+ example "Example of `build_info.yaml` in above cases:"
302+
```yaml title="build_info.yaml"
303+
Name: MyLibrary
304+
Platforms: [Windows, Linux, MacOS]
305+
LibraryType: Static
306+
IncludePaths:
307+
- "src/include"
308+
Build:
309+
DefaultPlatform:
310+
"g++":
311+
- "cd .. && cmake -B build"
312+
- "cd .. && cmake --build build"
313+
```

0 commit comments

Comments
 (0)