Skip to content

Commit 368dd65

Browse files
Updating build documentations
1 parent 45dc34c commit 368dd65

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

mkdocs/docs/build_settings.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@
4545
```yaml
4646
BuildType: Executable
4747
```
48+
49+
!!! warning
50+
When you specify `BuildType` as `Executable`, it will still produce a **shared library** for running.
51+
Under the hood, runcpp2 simply loads the shared library and call the `main()` function.
52+
53+
The reason of this behavior is because this makes it possible to "catch" if there's any
54+
missing external (shared) libraries that failed to be resolved, either because of missing
55+
`.dll`/`.so` or misconfigured search path.
56+
57+
This allows runcpp2 to differentiate a failure on resolving shared library and if the program
58+
just returns a non-zero exit code.
59+
60+
Therefore, when calling with the build flag `--build`, the output of the binary is **shared
61+
library instead of an executable**. This behavior can be **overridden** by passing the
62+
`--executable`/`-e` flag to force runcpp2 to produce the executable.
63+
4864
### `RequiredProfiles`
4965
- Type: `Platform Profile List`
5066
- Optional: `true`
@@ -58,21 +74,21 @@
5874
MacOS: ["g++"]
5975
```
6076
### `OverrideCompileFlags`
61-
- Type: `Platform Profile Map`
77+
- Type: `Platform Profile Map` with child fields
6278
- Optional: `true`
6379
- Default: None
64-
- Description: The compile flags to override for each platform and profile.
80+
- Description: The compile flags to override for the profile being run under each platform.
6581
- Child Fields:
6682
- `Remove`
6783
- Type: `string`
6884
- Optional: `true`
6985
- Default: None
70-
- Description: The compile flags to remove for each platform and profile.
86+
- Description: The compile flags to remove for the profile being run.
7187
- `Append`
7288
- Type: `string`
7389
- Optional: `true`
7490
- Default: None
75-
- Description: The compile flags to append for each platform and profile.
91+
- Description: The compile flags to append for the profile being run.
7692
??? example
7793
```yaml
7894
OverrideCompileFlags:
@@ -85,18 +101,18 @@
85101
- Type: `Platform Profile Map` with child fields
86102
- Optional: `true`
87103
- Default: None
88-
- Description: The link flags to override for each platform and profile.
104+
- Description: The link flags to override for the profile being run under each platform.
89105
- Child Fields:
90106
- `Remove`
91107
- Type: `string`
92108
- Optional: `true`
93109
- Default: None
94-
- Description: The link flags to remove for each platform and profile.
110+
- Description: The link flags to remove for the profile being run.
95111
- `Append`
96112
- Type: `string`
97113
- Optional: `true`
98114
- Default: None
99-
- Description: The link flags to append for each platform and profile.
115+
- Description: The link flags to append for the profile being run.
100116
??? example
101117
```yaml
102118
OverrideLinkFlags:
@@ -147,7 +163,7 @@
147163
- Type: `Platform Profile Map` with `list` of `string`
148164
- Optional: `true`
149165
- Default: None
150-
- Description: The setup commands to be used for each platform and profile.
166+
- Description: The setup commands to be used for each platform and profile. This runs before the script built for the first time.
151167
??? example
152168
```yaml
153169
Setup:
@@ -159,7 +175,7 @@
159175
- Type: `Platform Profile Map` with `list` of `string`
160176
- Optional: `true`
161177
- Default: None
162-
- Description: The pre-build commands to be used for each platform and profile.
178+
- Description: The pre-build commands to be used for each platform and profile. This runs before each build.
163179
??? example
164180
```yaml
165181
PreBuild:
@@ -171,7 +187,7 @@
171187
- Type: `Platform Profile Map` with `list` of `string`
172188
- Optional: `true`
173189
- Default: None
174-
- Description: The post-build commands to be used for each platform and profile.
190+
- Description: The post-build commands to be used for each platform and profile. This runs after each build.
175191
??? example
176192
```yaml
177193
PostBuild:
@@ -183,7 +199,7 @@
183199
- Type: `Platform Profile Map` with `list` of `string`
184200
- Optional: `true`
185201
- Default: None
186-
- Description: The cleanup commands to be used for each platform and profile.
202+
- Description: The cleanup commands to be used for each platform and profile. This runs when `--cleanup` command is specified.
187203
??? example
188204
```yaml
189205
Cleanup:

mkdocs/docs/guides/building_project_sources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ The `BuildType` setting specifies what type of output to build. There are four s
1818
!!! note
1919
If not specified, the default build type is Executable.
2020

21-
!!! important
22-
When you specify `BuildType` as `Executable`, it will still produce a **shared library**.
21+
!!! warning
22+
When you specify `BuildType` as `Executable`, it will still produce a **shared library** for running.
2323
Under the hood, runcpp2 simply loads the shared library and call the `main()` function.
2424

2525
The reason of this behavior is because this makes it possible to "catch" if there's any

0 commit comments

Comments
 (0)