Skip to content

Commit 92ac2e2

Browse files
committed
Added project config changes from #163 with some additions.
1 parent 8bde963 commit 92ac2e2

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

src/content/docs/Build Your Project/project-config.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,11 @@ This is a description of the configuration options in `project.json`:
102102
By default, an executable is assumed, but changing the type to `"static-lib"` or `"dynamic-lib"`
103103
creates static library and dynamic library targets respectively.
104104

105-
*This part will be updated, stay tuned*
106-
107105
## Compilation options
108106

109-
The project file contains common settings at the top level, that can be overridden by each
110-
target, by simply assigning that particular key. So if the top level defines `target` to be `macos-x64`
111-
and the actual target defines it to be `windows-x64`, then the `windows-x64` will be used for compilation.
107+
The project file contains common settings at the top level that can be overridden by each
108+
target by simply assigning that particular key. So if the top level defines `target`
109+
to be `macos-x64` and the actual target defines it to be `windows-x64`, then the `windows-x64` target will be used for compilation.
112110

113111
Similarly, compiler command line parameters can be used in turn to override the target setting.
114112

@@ -122,7 +120,11 @@ List of C3 libraries (".c3l") to use when compiling the target.
122120

123121
#### `sources`
124122

125-
List of source files to compile and for tests which will run.
123+
List of source files to compile.
124+
125+
#### `test-sources`
126+
127+
List of additional source files to compile when running tests.
126128

127129
#### `cc`
128130

@@ -139,27 +141,31 @@ This adds paths for the linker to search, when linking normal C libraries.
139141
#### `linked-libraries`
140142

141143
This is a list of C libraries to link to. The names need to follow the normal
142-
naming standard for how libraries are provided to the system linker,
143-
so for example on Linux, libraries have names like `libfoo.a` but when
144+
naming standard for how libraries are provided to the system linker.
145+
So, for example, on Linux libraries have names like `libfoo.a` but when
144146
presented to the linker the name is `foo`. As an example `"linked-libraries": ["curl"]`
145147
would on Linux look for the library `libcurl.a` and `libcurl.so` in the
146148
paths given by "linker-search-paths".
147149

148150
#### `version`
149151

150-
*Not handled yet*
152+
*Not handled yet.*
151153

152-
Version for library, will also be provided as a compile time constant.
154+
Version for the library. Will also be provided as a compile time constant.
153155

154156
#### `authors`
155157

156-
*Not handled yet*
158+
List of authors who are credited with creating and/or working on the project.
159+
160+
These can be accessed as lists using env::AUTHORS, which gives a list of names,
161+
and env::AUTHOR_EMAILS, which gives a list of their e-mails (where available).
157162

158-
List of authors to add for library compilation.
163+
The formatting is expected to be in the format "first last <optional email>",
164+
e.g. `John Doe <[email protected]>`.
159165

160166
#### `langrev`
161167

162-
*Not handled yet*
168+
*Not handled yet.*
163169

164170
The language revision to use.
165171

@@ -170,7 +176,7 @@ in the source code using `$feature(NAME_OF_FEATURE)`.
170176

171177
#### `warnings`
172178

173-
*Not completely supported yet*
179+
*Not completely supported yet.*
174180

175181
List of warnings to enable during compilation.
176182

@@ -182,14 +188,20 @@ Optimization setting: O0, O1, O2, O3, O4, O5, Os, Oz.
182188

183189
#### `type`
184190

185-
This mandatory option should be one of "executable", "dynamic-lib" and "static-lib".
191+
This mandatory option should be one of:
186192

187-
*More types will be added*
193+
1. "executable" – a normal executable application.
194+
2. "dynamic-lib" - a dynamic library.
195+
3. "static-lib" - static library.
196+
4. "benchmark" - target that only runs benchmarks.
197+
5. "test" - target that only runs tests.
198+
6. "object-files" - compile to object files, but does not perform any linking.
199+
7. "prepare" - target that does not perform any compilation, but may do things like invoking other scripts using "exec".
188200

189201
## Using environment variables
190202

191-
*Not supported yet*
203+
*Not supported yet.*
192204

193-
In addition to constants any values starting with "$" will be assumed to be environment variables.
205+
In addition to constants, any values starting with `$` will be assumed to be environment variables.
194206

195-
For example `"$HOME"` would on unix systems return the home directory. For strings that start with $ but *should not* be interpreted as an environment variable. For example, the string `"\$HOME"` would be interpreted as the plain string `"$HOME"`.
207+
For example `"$HOME"` would on Unix-like systems (e.g. Linux, the BSDs, Mac) return the home directory. For strings that start with `$` but *should not* be interpreted as an environment variable you need to escape it with a backslash (`\`). For example, the string `"\$HOME"` would be interpreted as the plain string `"$HOME"`.

0 commit comments

Comments
 (0)