use OFF for -DBUILD_TESTING instead

This commit is contained in:
Cheng-Yeh Chung
2025-04-09 17:21:13 +08:00
committed by GitHub
parent ff834e4519
commit 1c5443084c

View File

@@ -49,17 +49,17 @@ version of the library.
### CMake
To build the ninja binary without building the unit tests, disable test building by setting `BUILD_TESTING` to `false`:
To build the ninja binary without building the unit tests, disable test building by setting `BUILD_TESTING` to `OFF`:
```
cmake -Bbuild-cmake -DBUILD_TESTING=false
cmake -Bbuild-cmake -DBUILD_TESTING=OFF
cmake --build build-cmake
```
The `ninja` binary will now be inside the `build-cmake` directory (you can
choose any other name you like).
To run the unit tests, omit the `-DBUILD_TESTING=false` option, and after building, run:
To run the unit tests, omit the `-DBUILD_TESTING=OFF` option, and after building, run:
```
./build-cmake/ninja_test