diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-15 19:16:43 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 19:16:43 +0800 |
| commit | be42eeed7d9e510fea93922c615f1801bc54f336 (patch) | |
| tree | 029aaa2fdfcbe628f0985a42edf2a7f47c6fc54d /docs/building.md | |
| parent | 456df23cff531566dfe3a6ca7be998f1251b1774 (diff) | |
Lower minimum CMake version to 3.22 (#5295)
* Lower minimum CMake version to 3.22
Reverts https://github.com/shader-slang/slang/pull/4193
* Update build instructions to mention older CMake versions
Diffstat (limited to 'docs/building.md')
| -rw-r--r-- | docs/building.md | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/building.md b/docs/building.md index fa18ef60f..551b14491 100644 --- a/docs/building.md +++ b/docs/building.md @@ -9,7 +9,7 @@ version of Slang. Please install: -- CMake +- CMake (3.25 preferred, but 3.22 works[^cmake-version]) - A C++ compiler with support for C++17. GCC, Clang and MSVC are supported - A CMake compatible backend, for example Visual Studio or Ninja @@ -32,6 +32,8 @@ git clone https://github.com/shader-slang/slang --recursive ## Configure and build +> This section assumes cmake 3.25 or greater, if you're on a lower version please see [building with an older cmake](#older-cmake) + For a Ninja based build system (all platforms) run: ```bash cmake --preset default @@ -217,3 +219,21 @@ rm -rf build # The Visual Studio generator will complain if this is left over fr cmake --preset vs2022 --fresh -A arm64 -DSLANG_GENERATORS_PATH=generators/bin cmake --build --preset release ``` + +## Building with an older CMake {#older-cmake} + +Because older CMake versions don't support all the features we want to use in +CMakePresets, you'll have to do without the presets. Something like the following + +```bash +cmake -B build -G Ninja +cmake --build build -j +``` + +## Notes + +[^cmake-version] below 3.25, CMake lacks the ability to mark directories as being system +directories +(https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM), +this leads to an inability to suppress warnings originating in the dependencies +in `./external`, so be prepared for some additional warnings. |
