aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
commitfc41f7917531693680b5baf71ffe38c47333fe84 (patch)
treea6e62232e05e7779034c5f9d1bf743b6f1c198e3 /README.md
parentfe534f1497da6447153064d7bba00243000f803b (diff)
downloadnissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.tar.gz
nissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.zip
Make the project build with Microsoft's broken C compiler.
MSVC is not fully C11-compliant, even when compiling with /std:c11. Some changes were needed to make the codebase compatible. Notably, the notation a[static N] and a[n] for function parameters of array type is not supported, so that had to be hidden behind a macro. Atomic types are also an experimental feature, apparently, but at least they work with the correct compiler flag. One thing that MSVC does well, however, is warning on integer conversions on /W4 level. I am not sure if Clang and GCC have something similar, so I took this chance to fix some of these.
Diffstat (limited to '')
-rw-r--r--README.md39
1 files changed, 31 insertions, 8 deletions
diff --git a/README.md b/README.md
index 64871b5..c8ebbee 100644
--- a/README.md
+++ b/README.md
@@ -39,14 +39,26 @@ is going to configure `nissy` to use at most 3 threads, and build it with
39 39
40### Windows 40### Windows
41 41
42It is possible to build this project on Windows using `build.bat`. The 42It is possible to build this project on Windows using `build.bat`, using
43[Clang](https://clang.llvm.org/) compiler must be installed, and the 43either MSVC (default) or [Clang](https://clang.llvm.org/). In either case,
44command prompt must be correctly configured to run it. 44the command prompt must be correctly configured to run the compiler from
45the command line.
45 46
46We suggest installing Clang via the Visual Studio Installer, selecting 47For Clang, we suggest installing it via the Visual Studio Installer,
47the "C++ development" pack, as well as the "clang" and "Windows SDK 11" 48selecting the "C++ development" pack, as well as the "clang" and "Windows
48components. It is advised to use "x64 Native Tools Command Prompt for 49SDK 11" components. It is advised to use "x64 Native Tools Command Prompt
49VS 2022" instead of a regular command prompt to run the build script. 50for VS 2022" instead of a regular command prompt to run the build script.
51
52
53You can specify the compiler to use by setting the
54`CC` environment variable to either `clang` or `msvc`. For example:
55
56```
57> SET CC=clang
58> build.bat test
59```
60
61Will run all the tests using clang.
50 62
51The `build.bat` script has the same syntax as the `build.sh` script, 63The `build.bat` script has the same syntax as the `build.sh` script,
52but not all options are available. For example 64but not all options are available. For example
@@ -64,9 +76,20 @@ can be used to build the basic shell, while
64Builds and runs the unit tests. See `build.bat help` for a list of 76Builds and runs the unit tests. See `build.bat help` for a list of
65all available options. 77all available options.
66 78
67Note: The build script for Windows does not support all the options 79#### Caveats for building on Windows
80
81* The build script for Windows does not support all the options
68available with build.sh. If you want to tune the build options, you'll 82available with build.sh. If you want to tune the build options, you'll
69have to manually edit the build script. 83have to manually edit the build script.
84* If you are building on an old x86-64 machine that does not support AVX2
85instructions, you will have to manually set the architecture to `PORTABLE`
86with `SET ARCH=PORTABLE`.
87* Build on Windows on ARM has not been tested at all.
88* When building with MSVC, the option `/experimental:c11atomics` is used.
89Despite atomic types being part of the C11 standard for 15 years now,
90they have only [recently been
91implemented](https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2),
92and Microsoft still considers them an experimental feature. Impressive!
70 93
71## Running tests 94## Running tests
72 95

Generated with cgit - Back to sebastiano.tronto.net