ClickHouse/docs/_includes/cmake_in_clickhouse_header.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2020-09-17 15:09:59 +00:00
# CMake in ClickHouse
2020-09-10 15:57:18 +00:00
2020-09-17 15:09:59 +00:00
## TL; DR How to make ClickHouse compile and link faster?
2020-09-10 15:57:18 +00:00
Minimal ClickHouse build example:
2020-09-17 15:09:59 +00:00
```bash
2020-09-17 16:27:51 +00:00
cmake .. \
2022-01-15 23:31:22 +00:00
-DCMAKE_C_COMPILER=$(which clang-13) \
-DCMAKE_CXX_COMPILER=$(which clang++-13) \
2020-09-17 16:27:51 +00:00
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_CLICKHOUSE_ALL=OFF \
-DENABLE_CLICKHOUSE_SERVER=ON \
-DENABLE_CLICKHOUSE_CLIENT=ON \
-DENABLE_LIBRARIES=OFF \
-DUSE_UNWIND=ON \
2020-09-17 16:27:51 +00:00
-DENABLE_UTILS=OFF \
2020-09-17 15:09:59 +00:00
-DENABLE_TESTS=OFF
```
## CMake files types
1. ClickHouse's source CMake files (located in the root directory and in `/src`).
2. Arch-dependent CMake files (located in `/cmake/*os_name*`).
3. Libraries finders (search for contrib libraries, located in `/cmake/find`).
3. Contrib build CMake files (used instead of libraries' own CMake files, located in `/cmake/modules`)
2020-09-10 15:57:18 +00:00
## List of CMake flags
2020-09-19 17:31:41 +00:00
* This list is auto-generated by [this Python script](https://github.com/clickhouse/clickhouse/blob/master/docs/tools/cmake_in_clickhouse_generator.py).
2020-09-10 15:57:18 +00:00
* The flag name is a link to its position in the code.
* If an option's default value is itself an option, it's also a link to its position in this list.