Skip to content

Commit ee6cbb6

Browse files
committed
Documentation update. No version bump.
1 parent 561bc32 commit ee6cbb6

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

README/BUILD.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,44 @@ In Windows CMake offers various versions for MSVC. Again below only the command
1919

2020
## Build the tidy library and command line tool
2121

22-
1. `cd build/cmake`
22+
### macOS/Linux/Unix
2323

24-
2. `cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]`
24+
~~~
25+
cd build/cmake
26+
cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]
27+
make
28+
[sudo] make install
29+
~~~
2530

26-
3. Windows: `cmake --build . --config Release`
27-
Unix/OS X: `make`
31+
### macOS (multi-architecture)
2832

29-
4. Install, if desired:
30-
Windows: `cmake --build . --config Release --target INSTALL`
31-
Unix/OS X: `[sudo] make install`
33+
~~~
34+
cd build/cmake
35+
cmake ../.. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
36+
make
37+
[sudo] make install
38+
~~~
3239

33-
By default cmake sets the install path to `/usr/local/bin` in Unix. If you wanted the binary in say `/usr/bin` instead, then in 2. above use `-DCMAKE_INSTALL_PREFIX=/usr`.
40+
### Windows
3441

35-
Also, in Unix if you want to build the release library without any debug `assert` in the code then add `-DCMAKE_BUILD_TYPE=Release` in step 2. This adds a `-DNDEBUG` macro to the compile switches. This is normally added in windows build for the `Release` config.
42+
~~~
43+
cd build/cmake
44+
cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]
45+
cmake --build . --config Release
46+
cmake --build . --config Release --target INSTALL
47+
~~~
48+
49+
### Build options
50+
51+
By default cmake sets the install path to `/usr/local/bin` in Unix. If you wanted the binary in say `/usr/bin` instead, then in the second step, use `-DCMAKE_INSTALL_PREFIX=/usr`.
52+
53+
Also, in Unix if you want to build the release library without any debug `assert` in the code then add `-DCMAKE_BUILD_TYPE=Release` in the second step. This adds a `-DNDEBUG` macro to the compile switches. This is normally added in windows build for the `Release` config.
3654

3755
In Windows the default install is to `C:\Program Files\tidy`, or `C:/Program Files (x86)/tidy`, which is not very useful. After the build the `tidy.exe` is in the `Release` directory, and can be copied to any directory in your `PATH` environment variable for global use.
3856

39-
If you do **not** need the tidy library built as a 'shared' (DLL) library, then in 2. add the command `-DBUILD_SHARED_LIB:BOOL=OFF`. This option is **ON** by default. The static library is always built and linked with the command line tool for convenience in Windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.
57+
On macOS, you can build for both Intel and Apple Silicon by adding "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" in the second step.
58+
59+
If you do **not** need the tidy library built as a 'shared' (DLL) library, then in the second step add the command `-DBUILD_SHARED_LIB:BOOL=OFF`. This option is **ON** by default. The static library is always built and linked with the command line tool for convenience in Windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.
4060

4161
See the `CMakeLists.txt` file for other CMake **options** offered.
4262

0 commit comments

Comments
 (0)