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
@@ -6,41 +6,39 @@ Binary packages are available from our https://github.com/cppalliance/mrdox/rele
6
6
7
7
== Source
8
8
9
-
For consistency, these instructions assume you are using the `SRC_DIR` variable to refer to the directory where you are going to clone MrDox and any other requirements.
10
-
Please create an environment variable with that directory and adjust it accordingly.
11
-
For instance:
9
+
=== Cloning MrDox
12
10
13
-
Windows (Command Prompt):
14
-
15
-
[source,commandline]
16
-
----
17
-
set SRC_DIR=C:\Users\%USERNAME%\src
18
-
echo %SRC_DIR%
19
-
----
20
-
21
-
Windows (PowerShell):
11
+
Clone the MrDox repository with:
22
12
23
13
[source,bash]
24
14
----
25
-
$env:SRC_DIR = "C:\Users\$env:USERNAME\src"
26
-
echo $env:SRC_DIR
15
+
git clone https://github.com/cppalliance/mrdox
27
16
----
28
17
29
-
Unix-variants (Linux, macOS, etc.):
18
+
=== Requirements
19
+
20
+
Create and go to the `third-party` directory, where we are going to download and install our custom dependencies:
30
21
31
22
[source,bash]
32
23
----
33
-
export SRC_DIR="$HOME/src"
34
-
echo $SRC_DIR
24
+
mkdir third-party
25
+
cd third-party
35
26
----
36
27
37
-
=== Requirements
28
+
[NOTE]
29
+
====
30
+
These instructions assume all dependencies are installed in the `third-party` directory for simplicity.
31
+
Fell free to install them anywhere you want and adjust the main MrDox configuration command later.
32
+
====
33
+
34
+
=== LLVM
38
35
39
-
==== LLVM
36
+
MrDox depends on a specific recent version of LLVM: https://github.com/llvm/llvm-project/tree/731264b0c2af7aa46bd39625202a99e06cfccff9[731264b0]
40
37
41
-
MrDox depends on a recent version of LLVM.
38
+
Because building LLVM may take many hours to complete, we provide pre-built binaries for Windows and Linux: https://mrdox.com/llvm+clang/[LLVM Releases].
39
+
You can download the binaries and uncompress them in the `./third-party/llvm+clang` directory.
42
40
43
-
Here are the instructions to clone LLVM version required by this project.
41
+
Alternatively, if building LLVM from source, you can clone the project from the official repository:
As you can see from the step above, we configure a `RelWithDebInfo` version of LLVM for MrDox by default.
67
+
This is a release build with debug information.
68
+
Other possible CMake configurations supported by LLVM are `Debug` (including debug information and no optimizations), `Release` (including optimizations and no debug information), and `MinSizeRel` (which optimizes for size).
69
+
70
+
[NOTE]
71
+
====
72
+
Developers might also want to build a custom `Debug` LLVM configuration including optimizations, which allows for faster execution of tests.
73
+
To create such an installation, set `CMAKE_CONFIGURATION_TYPES` or `CMAKE_BUILD_TYPE` to `Debug` and manually include the optimization flags to `-D CMAKE_CXX_FLAGS="/O2 /Zi"` (MSVC) or `-D CMAKE_CXX_FLAGS="-Og -g"`.
74
+
75
+
This should give you an optimized build with all debug features and flags, such as an appropriate https://learn.microsoft.com/en-us/cpp/standard-library/iterator-debug-level[`_ITERATOR_DEBUG_LEVEL`] and the `/MDd` flag in MSVC.
76
+
In other platforms, this should give you a release somewhat equivalent to `RelWithDebInfo` optimized for debugging experience. `-Og` offers a reasonable level of optimization while maintaining fast compilation and a good debugging experience.
77
+
78
+
This custom configuration can be installed in an alternative directory, such as `../llvm+clang/DebWithOpt`, to be used by the MrDox `Debug` builds by developers.
The MrDox repository also includes a `CMakePresets.json` file that contains the parameters to configure MrDox with CMake.
178
+
179
+
To specify the installation directories, you can use the `LLVM_ROOT`, `DUKTAPE_SOURCE_ROOT`, `CMAKE_TOOLCHAIN_FILE` environment variables.
180
+
To specify a generator (`-G`) and platform name (`-A`), you can use the `CMAKE_GENERATOR` and `CMAKE_GENERATOR_PLATFORM` environment variables.
181
+
182
+
Alternatively, you can create a `CMakeUserPresets.json` file in the `mrdox` directory with the specific values you want to override in each configuration.
183
+
This is typically more convenient than using environment variables when working on an IDE.
184
+
The repository includes a `CMakeUserPresets.json.example` file that can be used as a template.
185
+
====
186
+
144
187
Then build and install it with:
145
188
146
189
[source,bash]
147
190
----
148
191
cd build
149
-
cmake --build . -j <threads>
192
+
cmake --build .
150
193
cmake --install .
151
194
----
152
195
196
+
To customize the installation directory, use the `CMAKE_INSTALL_PREFIX` option or use the `--prefix` option for the `cmake --install .` command.
197
+
To customize the C and C++ compilers, use the `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER` options.
198
+
199
+
[NOTE]
200
+
====
201
+
Developers should also enable `-D BUILD_TESTING=ON`.
202
+
If any custom build of LLVM is being used (such as `DebWithOpt`), the `LLVM_ROOT` variable should be set to the installation directory of that build.
203
+
====
204
+
153
205
== Package layout
154
206
155
207
The MrDox installation directory follows the "Filesystem Hierarchy Standard" (FHS) layout:
0 commit comments