You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main motivation behind this change is to make it easier to package
Descent 3 for Linux. For example, let’s say that you’re packaging
Descent 3 for Debian and you want to make the package work well with
Debian’s game-data-packager. The package for the Descent 3 engine will
put d3-linux.hog in one directory, and the package for the proprietary
Descent 3 game data will put d3.hog into a different directory [1]. The
Descent 3 engine package can use the DEFAULT_ADDITIONAL_DIRS CMake
option in order to make sure that both d3-linux.hog and d3.hog are
located automatically.
For the example value in USAGE.md, I decided to use Windows paths in
order to showcase the fact that you have to escape backslashes.
[1]: <#373 (comment)>
Copy file name to clipboardExpand all lines: BUILD.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,14 +179,15 @@ cmake --preset linux -DENABLE_LOGGER=ON
179
179
180
180
**NOTE:** CMake variables, or more technically _CMake cache entries_, will persist in their values until they are explicitly cleared. So, if you set a variable and then run another CMake command _without_ that variable specified, the variable will still be set. Variables must be explicitly unset, or the `builds/` directory cleaned, in order to be cleared.
|`CMAKE_BUILD_TYPE`|`Debug` builds are generally larger, slower and contain extra correctness checks that will validate game data and interrupt gameplay when problems are detected.<br>`Release` builds are optimized for size and speed and do not include debugging information, which makes it harder to find problems. |`Debug`|
|`FORCE_COLORED_OUTPUT`| Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with Ninja). |`OFF`|
190
-
|`FORCE_PORTABLE_INSTALL`| Install all files into local directory defined by `CMAKE_INSTALL_PREFIX`. |`ON`|
191
-
|`USE_EXTERNAL_PLOG`| Use system plog library. |`OFF`|
192
-
|`USE_VCPKG`| Explicitly control whether or not to use vcpkg for dependency resolution. `ON` requires the environment variable `VCPKG_ROOT` to be set. | Determined by the existence of `VCPKG_ROOT` in the environment: If it exists, vcpkg is used. |
|`CMAKE_BUILD_TYPE`|`Debug` builds are generally larger, slower and contain extra correctness checks that will validate game data and interrupt gameplay when problems are detected.<br>`Release` builds are optimized for size and speed and do not include debugging information, which makes it harder to find problems. |`Debug`|
|`DEFAULT_ADDITIONAL_DIRS`| A list of directories that Descent 3 will use as read-only base directories (see [USAGE.md’s Base directories section](./USAGE.md#base-directories)). This value gets interpreted as a C++ expression, so you’ll need to use C++’s syntax. Here’s an example of a valid value: <prelang=cpp>`{"C:\\Games\\Descent3\\", "D:\\"}`</pre> |`{}`|
188
+
|`ENABLE_LOGGER`| Enable logging to the terminal. |`OFF`|
|`FORCE_COLORED_OUTPUT`| Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with Ninja). |`OFF`|
191
+
|`FORCE_PORTABLE_INSTALL`| Install all files into local directory defined by `CMAKE_INSTALL_PREFIX`. |`ON`|
192
+
|`USE_EXTERNAL_PLOG`| Use system plog library. |`OFF`|
193
+
|`USE_VCPKG`| Explicitly control whether or not to use vcpkg for dependency resolution. `ON` requires the environment variable `VCPKG_ROOT` to be set. | Determined by the existence of `VCPKG_ROOT` in the environment: If it exists, vcpkg is used. |
Copy file name to clipboardExpand all lines: USAGE.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,18 +92,19 @@ Descent 3 has two types of base directories:
92
92
- The writable base directory can contain both read-write files and read-only files. There is only one writeable base directory. By default, the writable base directory gets set to the current working directory.
93
93
- The read-only base directories can only contain read-only files. There can be any number of read-only base directories. By default, Descent 3 uses zero read-only base directories.
94
94
95
-
You can set the writable base directory and the list of read-only base directories using the `-setdir`, `-useexedir` and `-additionaldir` command-line options (see [the next section](#command-line-options)).
95
+
You can set the writable base directory and the list of read-only base directories using the `-setdir`, `-useexedir` and `-additionaldir` command-line options (see [the next section](#command-line-options)). Descent 3 also has a list of default read-only base directories. Normally, the list of default read-only base directories is empty, but you can change it by using the `DEFAULT_ADDITIONAL_DIRS` CMake option when compiling Descent 3 (see [BUILD.md’s Build Options section](./BUILD.md#build-options)).
96
96
97
97
When Descent 3 tries to find a read-only file, then it will look through the list of base directories in this order:
98
98
99
99
- the last read-only base directory that was specified on the command-line,
100
100
- the second-to-last read-only base directory that was specified on the command-line,
101
101
- the third-to-last read-only base directory that was specified on the command-line,
102
102
- …
103
-
- the first read-only base directory that was specified on the command-line and, finally,
103
+
- the first read-only base directory that was specified on the command-line,
104
+
- all of the items on the `DEFAULT_ADDITIONAL_DIRS` list in reverse order, and, finally,
104
105
- the writable base directory.
105
106
106
-
Files that are in base directories that are higher on that list will override files that are in base directories that are lower on that list. For example, lets say that you run Descent 3 like this:
107
+
Files that are in base directories that are higher on that list will override files that are in base directories that are lower on that list. For example, lets say that the `DEFAULT_ADDITIONAL_DIRS` list is empty and that you run Descent 3 like this:
0 commit comments