fix: subsitution

This commit is contained in:
myrrc 2020-09-11 00:48:56 +03:00
parent 5dbfb3771b
commit 3319933dc9
3 changed files with 148 additions and 53 deletions

View File

@ -5,7 +5,7 @@
### Don't be obvious. Be informative. ### Don't be obvious. Be informative.
Bad: Bad:
``` ```cmake
option (ENABLE_TESTS "Enables testing" OFF) option (ENABLE_TESTS "Enables testing" OFF)
``` ```
@ -14,7 +14,7 @@ purpose. If the option's name is quite self-descriptive, prefer the empty descri
Better: Better:
``` ```cmake
option(ENABLE_TESTS OFF) option(ENABLE_TESTS OFF)
``` ```
@ -24,7 +24,7 @@ The comment is parsed into a separate column (see below).
Even better (default off value is omitted): Even better (default off value is omitted):
``` ```cmake
# Adds the ability to test ClickHouse using Google.Test (would produce another target unit_tests_dbms). # Adds the ability to test ClickHouse using Google.Test (would produce another target unit_tests_dbms).
# see tests/CMakeLists.txt for implementation detail. # see tests/CMakeLists.txt for implementation detail.
option(ENABLE_GTEST_TESTS) option(ENABLE_GTEST_TESTS)
@ -38,7 +38,7 @@ In that case, prefer explicitly raising a warning telling the developer that he
Also, such options should be disabled if applies. Also, such options should be disabled if applies.
Bad: Bad:
``` ```cmake
option(STRIP_DEBUG_SYMBOLS_FUNCTIONS option(STRIP_DEBUG_SYMBOLS_FUNCTIONS
"Do not generate debugger info for ClickHouse functions. "Do not generate debugger info for ClickHouse functions.
${STRIP_DSF_DEFAULT}) ${STRIP_DSF_DEFAULT})
@ -50,7 +50,7 @@ endif()
``` ```
Better: Better:
``` ```cmake
# Provides faster linking and lower binary size. # Provides faster linking and lower binary size.
# Tradeoff is the inability to debug some source files with e.g. gdb # Tradeoff is the inability to debug some source files with e.g. gdb
# (empty stack frames and no local variables)." # (empty stack frames and no local variables)."
@ -71,13 +71,13 @@ You may find that the option's name is self-descriptive.
Bad: Bad:
``` ```cmake
option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON) option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON)
``` ```
Better: Better:
``` ```cmake
# Only applicable for clang. # Only applicable for clang.
# Turned off when building with tests or sanitizers. # Turned off when building with tests or sanitizers.
option(ENABLE_THINLTO ON). option(ENABLE_THINLTO ON).
@ -90,13 +90,13 @@ the tool's docs. It won't take much of your time.
Bad: Bad:
``` ```cmake
option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON) option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON)
``` ```
Better (combined with the above hint): Better (combined with the above hint):
``` ```cmake
# https://clang.llvm.org/docs/ThinLTO.html # https://clang.llvm.org/docs/ThinLTO.html
# Only applicable for clang. # Only applicable for clang.
# Turned off when building with tests or sanitizers. # Turned off when building with tests or sanitizers.
@ -105,13 +105,13 @@ option(ENABLE_THINLTO ON).
Other example, bad: Other example, bad:
``` ```cmake
option (USE_INCLUDE_WHAT_YOU_USE "Use 'include-what-you-use' tool" OFF) option (USE_INCLUDE_WHAT_YOU_USE "Use 'include-what-you-use' tool" OFF)
``` ```
Better: Better:
``` ```cmake
# https://github.com/include-what-you-use/include-what-you-use # https://github.com/include-what-you-use/include-what-you-use
option (USE_INCLUDE_WHAT_YOU_USE) option (USE_INCLUDE_WHAT_YOU_USE)
``` ```

View File

@ -5,7 +5,7 @@
### Don't be obvious. Be informative. ### Don't be obvious. Be informative.
Bad: Bad:
``` ```cmake
option (ENABLE_TESTS "Enables testing" OFF) option (ENABLE_TESTS "Enables testing" OFF)
``` ```
@ -14,7 +14,7 @@ purpose. If the option's name is quite self-descriptive, prefer the empty descri
Better: Better:
``` ```cmake
option(ENABLE_TESTS OFF) option(ENABLE_TESTS OFF)
``` ```
@ -24,7 +24,7 @@ The comment is parsed into a separate column (see below).
Even better (default off value is omitted): Even better (default off value is omitted):
``` ```cmake
# Adds the ability to test ClickHouse using Google.Test (would produce another target unit_tests_dbms). # Adds the ability to test ClickHouse using Google.Test (would produce another target unit_tests_dbms).
# see tests/CMakeLists.txt for implementation detail. # see tests/CMakeLists.txt for implementation detail.
option(ENABLE_GTEST_TESTS) option(ENABLE_GTEST_TESTS)
@ -38,7 +38,7 @@ In that case, prefer explicitly raising a warning telling the developer that he
Also, such options should be disabled if applies. Also, such options should be disabled if applies.
Bad: Bad:
``` ```cmake
option(STRIP_DEBUG_SYMBOLS_FUNCTIONS option(STRIP_DEBUG_SYMBOLS_FUNCTIONS
"Do not generate debugger info for ClickHouse functions. "Do not generate debugger info for ClickHouse functions.
${STRIP_DSF_DEFAULT}) ${STRIP_DSF_DEFAULT})
@ -50,7 +50,7 @@ endif()
``` ```
Better: Better:
``` ```cmake
# Provides faster linking and lower binary size. # Provides faster linking and lower binary size.
# Tradeoff is the inability to debug some source files with e.g. gdb # Tradeoff is the inability to debug some source files with e.g. gdb
# (empty stack frames and no local variables)." # (empty stack frames and no local variables)."
@ -71,13 +71,13 @@ You may find that the option's name is self-descriptive.
Bad: Bad:
``` ```cmake
option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON) option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON)
``` ```
Better: Better:
``` ```cmake
# Only applicable for clang. # Only applicable for clang.
# Turned off when building with tests or sanitizers. # Turned off when building with tests or sanitizers.
option(ENABLE_THINLTO ON). option(ENABLE_THINLTO ON).
@ -90,13 +90,13 @@ the tool's docs. It won't take much of your time.
Bad: Bad:
``` ```cmake
option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON) option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON)
``` ```
Better (combined with the above hint): Better (combined with the above hint):
``` ```cmake
# https://clang.llvm.org/docs/ThinLTO.html # https://clang.llvm.org/docs/ThinLTO.html
# Only applicable for clang. # Only applicable for clang.
# Turned off when building with tests or sanitizers. # Turned off when building with tests or sanitizers.
@ -105,13 +105,13 @@ option(ENABLE_THINLTO ON).
Other example, bad: Other example, bad:
``` ```cmake
option (USE_INCLUDE_WHAT_YOU_USE "Use 'include-what-you-use' tool" OFF) option (USE_INCLUDE_WHAT_YOU_USE "Use 'include-what-you-use' tool" OFF)
``` ```
Better: Better:
``` ```cmake
# https://github.com/include-what-you-use/include-what-you-use # https://github.com/include-what-you-use/include-what-you-use
option (USE_INCLUDE_WHAT_YOU_USE) option (USE_INCLUDE_WHAT_YOU_USE)
``` ```
@ -124,29 +124,114 @@ Prefer the `ON/OFF` values, if possible.
## List of CMake flags ## List of CMake flags
* This list is auto-generated by [this bash script](bash.sh). * This list is auto-generated by [this bash script](cmake_flags_md_generator.sh).
* The flag name is a link to its position in the code. * The flag name is a link to its position in the code.
| Name | Default value | Description | Comment | | Name | Default value | Description | Comment |
|------|---------------|-------------|---------| |------|---------------|-------------|---------|
| (`ENABLE_CLANG_TIDY`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/analysis.cmake] | `OFF` | Use 'clang-tidy' static analyzer if present | | | [`ENABLE_IPO`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `` | Enable full link time optimization | |
| (`USE_INTERNAL_`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/contrib_finder.cmake] | `${LIB_NAME_UC}_LIBRARY "Use bundled library ${LIB_NAME} instead of system" ${NOT_UNBUNDLED}` | | | | [`USE_STATIC_LIBRARIES`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Set to FALSE to use shared libraries | |
| (`FUZZER`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/fuzzer.cmake] | `` | Enable fuzzer: libfuzzer | | | [`MAKE_STATIC_LIBRARIES`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `${USE_STATIC_LIBRARIES}` | Set to FALSE to make shared libraries | |
| (`PARALLEL_COMPILE_JOBS`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake] | `` | Define the maximum number of concurrent compilation jobs" " | | | [`SPLIT_SHARED_LIBRARIES`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | DEV ONLY. Keep all internal libs as separate .so for faster linking | |
| (`PARALLEL_LINK_JOBS`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake] | `` | Define the maximum number of concurrent link jobs" " | | | [`CLICKHOUSE_SPLIT_BINARY`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | Make several binaries instead one bundled (clickhouse-server, clickhouse-client, ... ) | |
| (`SANITIZE`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/sanitize.cmake] | `` | Enable sanitizer: address, memory, thread, undefined" " | | | [`ENABLE_FUZZING`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | Enables fuzzing instrumentation | |
| (`LINKER_NAME`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/tools.cmake] | `` | Linker name or full path | | | [`ENABLE_TESTS`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Enables tests | |
| (`WEVERYTHING`)[http://github.com/clickhouse/clickhouse/blob/master/cmake/warnings.cmake] | `ON` | Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang. | | | [`GLIBC_COMPATIBILITY`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies ENABLE_FASTMEMCPY. | |
| (`ENABLE_CLICKHOUSE_ALL`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `ON` | Enable all tools | | | [`ADD_GDB_INDEX_FOR_GOLD`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `0` | Set to add .gdb-index to resulting binaries for gold linker. NOOP if lld is used. | |
| (`ENABLE_CLICKHOUSE_SERVER`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-server | | | [`COMPILER_PIPE`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | -pipe compiler option [less /tmp usage, more ram usage] | |
| (`ENABLE_CLICKHOUSE_CLIENT`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-client | | | [`ARCH_NATIVE`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `0` | Enable -march=native compiler flag | |
| (`ENABLE_CLICKHOUSE_LOCAL`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-local | | | [`WITH_COVERAGE`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `0` | Build with coverage. | |
| (`ENABLE_CLICKHOUSE_BENCHMARK`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-benchmark | | | [`ENABLE_THINLTO`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers. | |
| (`ENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-extract-from-config | | | [`ENABLE_LIBRARIES`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Enable all libraries (Global default switch) | |
| (`ENABLE_CLICKHOUSE_COMPRESSOR`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-compressor | | | [`UNBUNDLED`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | Try find all libraries in system. We recommend to avoid this mode for production builds, because we cannot guarantee exact versions and variants of libraries your system has installed. This mode exists for enthusiastic developers who search for trouble. Also it is useful for maintainers of OS packages. | |
| (`ENABLE_CLICKHOUSE_COPIER`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-copier | | | [`WERROR`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | Enable -Werror compiler option | |
| (`ENABLE_CLICKHOUSE_FORMAT`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-format | | | [`WERROR`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `ON` | Enable -Werror compiler option | |
| (`ENABLE_CLICKHOUSE_OBFUSCATOR`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-obfuscator | | | [`USE_INCLUDE_WHAT_YOU_USE`](http://github.com/clickhouse/clickhouse/blob/master//CMakeLists.txt) | `OFF` | Use 'include-what-you-use' tool | |
| (`ENABLE_CLICKHOUSE_ODBC_BRIDGE`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-odbc-bridge | | | [`ENABLE_CLANG_TIDY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/analysis.cmake) | `OFF` | Use 'clang-tidy' static analyzer if present | |
| (`ENABLE_CLICKHOUSE_INSTALL`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `OFF` | Enable clickhouse-install | | | [`USE_INTERNAL_`](http://github.com/clickhouse/clickhouse/blob/master/cmake/contrib_finder.cmake) | `${LIB_NAME_UC}_LIBRARY "Use bundled library ${LIB_NAME} instead of system" ${NOT_UNBUNDLED}` | | |
| (`ENABLE_CLICKHOUSE_INSTALL`)[http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt] | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-install | | | [`FUZZER`](http://github.com/clickhouse/clickhouse/blob/master/cmake/fuzzer.cmake) | `` | Enable fuzzer: libfuzzer | |
| [`PARALLEL_COMPILE_JOBS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake) | `` | Define the maximum number of concurrent compilation jobs" " | |
| [`PARALLEL_LINK_JOBS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake) | `` | Define the maximum number of concurrent link jobs" " | |
| [`SANITIZE`](http://github.com/clickhouse/clickhouse/blob/master/cmake/sanitize.cmake) | `` | Enable sanitizer: address, memory, thread, undefined" " | |
| [`LINKER_NAME`](http://github.com/clickhouse/clickhouse/blob/master/cmake/tools.cmake) | `` | Linker name or full path | |
| [`WEVERYTHING`](http://github.com/clickhouse/clickhouse/blob/master/cmake/warnings.cmake) | `ON` | Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang. | |
| [`ENABLE_AMQPCPP`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/amqpcpp.cmake) | `${ENABLE_LIBRARIES}` | Enalbe AMQP-CPP | |
| [`ENABLE_AVRO`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/avro.cmake) | `${ENABLE_LIBRARIES}` | Enable Avro | |
| [`ENABLE_BASE`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/base64.cmake) | `64 "Enable base64" ${ENABLE_LIBRARIES}` | | |
| [`ENABLE_BROTLI`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake) | `${ENABLE_LIBRARIES}` | Enable brotli | |
| [`USE_INTERNAL_BROTLI_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake) | `${USE_STATIC_LIBRARIES}` | Set to FALSE to use system libbrotli library instead of bundled | |
| [`USE_INTERNAL_BROTLI_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake) | `ON` | Set to FALSE to use system libbrotli library instead of bundled | |
| [`ENABLE_CAPNP`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake) | `${ENABLE_LIBRARIES}` | Enable Cap'n Proto | |
| [`USE_INTERNAL_CAPNP_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system capnproto library instead of bundled | |
| [`ENABLE_CASSANDRA`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/cassandra.cmake) | `${ENABLE_LIBRARIES}` | Enable Cassandra | |
| [`ENABLE_CCACHE`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/ccache.cmake) | `${ENABLE_CCACHE_BY_DEFAULT}` | Speedup re-compilations using ccache | |
| [`ENABLE_CURL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake) | `${ENABLE_LIBRARIES}` | Enable curl | |
| [`USE_INTERNAL_CURL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake) | `${NOT_UNBUNDLED}` | Use internal curl library | |
| [`USE_LIBCXX`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake) | `${NOT_UNBUNDLED}` | Use libc++ and libc++abi instead of libstdc++ | |
| [`USE_INTERNAL_LIBCXX_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake) | `${USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT}` | Set to FALSE to use system libcxx and libcxxabi libraries instead of bundled | |
| [`ENABLE_FASTOPS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/fastops.cmake) | `${ENABLE_LIBRARIES}` | Enable fast vectorized mathematical functions library by Mikhail Parakhin | |
| [`ENABLE_GPERF`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/gperf.cmake) | `${ENABLE_LIBRARIES}` | Use gperf function hash generator tool | |
| [`ENABLE_GRPC`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/grpc.cmake) | `${ENABLE_LIBRARIES}` | Use gRPC | |
| [`ENABLE_GTEST_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake) | `${ENABLE_LIBRARIES}` | Enable gtest library | |
| [`USE_INTERNAL_GTEST_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system Google Test instead of bundled | |
| [`ENABLE_H`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/h3.cmake) | `3 "Enable H3" ${ENABLE_LIBRARIES}` | | |
| [`ENABLE_HDFS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake) | `${ENABLE_LIBRARIES}` | Enable HDFS | |
| [`USE_INTERNAL_HDFS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake) | `3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled (experimental - set to OFF on your own risk` | | |
| [`ENABLE_ICU`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake) | `${ENABLE_LIBRARIES}` | Enable ICU | |
| [`ENABLE_ICU`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake) | `0` | Enable ICU | |
| [`USE_INTERNAL_ICU_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system ICU library instead of bundled | |
| [`ENABLE_LDAP`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake) | `${ENABLE_LIBRARIES}` | Enable LDAP | |
| [`USE_INTERNAL_LDAP_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system *LDAP library instead of bundled | |
| [`ENABLE_GSASL_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake) | `${ENABLE_LIBRARIES}` | Enable gsasl library | |
| [`USE_INTERNAL_LIBGSASL_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake) | `${USE_STATIC_LIBRARIES}` | Set to FALSE to use system libgsasl library instead of bundled | |
| [`USE_INTERNAL_LIBGSASL_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake) | `ON` | Set to FALSE to use system libgsasl library instead of bundled | |
| [`USE_INTERNAL_LIBXML`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/libxml2.cmake) | `2_LIBRARY "Set to FALSE to use system libxml2 library instead of bundled" ${NOT_UNBUNDLED}` | | |
| [`ENABLE_EMBEDDED_COMPILER`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake) | `${ENABLE_LIBRARIES}` | Set to TRUE to enable support for 'compile_expressions' option for query execution | |
| [`USE_INTERNAL_LLVM_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake) | `${NOT_UNBUNDLED}` | Use bundled or system LLVM library. | |
| [`LLVM_HAS_RTTI`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake) | `ON` | Enable if LLVM was build with RTTI enabled | |
| [`ENABLE_MSGPACK`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake) | `${ENABLE_LIBRARIES}` | Enable msgpack library | |
| [`USE_INTERNAL_MSGPACK_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system msgpack library instead of bundled | |
| [`ENABLE_MYSQL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake) | `${ENABLE_LIBRARIES}` | Enable MySQL | |
| [`ENABLE_MYSQL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake) | `FALSE` | Enable MySQL | |
| [`USE_INTERNAL_MYSQL_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system mysqlclient library instead of bundled | |
| [`ENABLE_ODBC`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake) | `${ENABLE_LIBRARIES}` | Enable ODBC library | |
| [`USE_INTERNAL_ODBC_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake) | `${NOT_UNBUNDLED}` | Use internal ODBC library | |
| [`ENABLE_OPENCL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/opencl.cmake) | `${ENABLE_LIBRARIES}` | Enable OpenCL support | |
| [`ENABLE_ORC`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake) | `${ENABLE_LIBRARIES}` | Enable ORC | |
| [`USE_INTERNAL_ORC_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake) | `"Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk` | | |
| [`ENABLE_PARQUET`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake) | `${ENABLE_LIBRARIES}` | Enable parquet | |
| [`USE_INTERNAL_PARQUET_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system parquet library instead of bundled | |
| [`USE_INTERNAL_POCO_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/poco.cmake) | `ON` | Use internal Poco library | |
| [`ENABLE_PROTOBUF`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake) | `${ENABLE_LIBRARIES}` | Enable protobuf | |
| [`USE_INTERNAL_PROTOBUF_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system protobuf instead of bundled | |
| [`ENABLE_RAPIDJSON`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake) | `${ENABLE_LIBRARIES}` | Use rapidjson | |
| [`USE_INTERNAL_RAPIDJSON_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system rapidjson library instead of bundled | |
| [`ENABLE_RDKAFKA`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake) | `${ENABLE_LIBRARIES}` | Enable kafka | |
| [`USE_INTERNAL_RDKAFKA_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system librdkafka instead of the bundled | |
| [`USE_INTERNAL_RE`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/re2.cmake) | `2_LIBRARY "Set to FALSE to use system re2 library instead of bundled [slower]" ${NOT_UNBUNDLED}` | | |
| [`ENABLE_S`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake) | `3 "Enable S3" ${ENABLE_LIBRARIES}` | | |
| [`USE_INTERNAL_AWS_S`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake) | `3_LIBRARY "Set to FALSE to use system S3 instead of bundled (experimental set to OFF on your own risk` | | |
| [`USE_SENTRY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/sentry.cmake) | `${ENABLE_LIBRARIES}` | Use Sentry | |
| [`USE_SIMDJSON`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/simdjson.cmake) | `${ENABLE_LIBRARIES}` | Use simdjson | |
| [`USE_SNAPPY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake) | `${ENABLE_LIBRARIES}` | Enable support of snappy library | |
| [`USE_INTERNAL_SNAPPY_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system snappy library instead of bundled | |
| [`ENABLE_SSL`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake) | `${ENABLE_LIBRARIES}` | Enable ssl | |
| [`USE_INTERNAL_SSL_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system *ssl library instead of bundled | |
| [`ENABLE_STATS`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/stats.cmake) | `${ENABLE_LIBRARIES}` | Enalbe StatsLib library | |
| [`USE_UNWIND`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/unwind.cmake) | `${ENABLE_LIBRARIES}` | Enable libunwind (better stacktraces) | |
| [`USE_INTERNAL_ZLIB_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/zlib.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system zlib library instead of bundled | |
| [`USE_INTERNAL_ZSTD_LIBRARY`](http://github.com/clickhouse/clickhouse/blob/master/cmake/find/zstd.cmake) | `${NOT_UNBUNDLED}` | Set to FALSE to use system zstd library instead of bundled | |
| [`ENABLE_CLICKHOUSE_ALL`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `ON` | Enable all tools | |
| [`ENABLE_CLICKHOUSE_SERVER`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-server | |
| [`ENABLE_CLICKHOUSE_CLIENT`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-client | |
| [`ENABLE_CLICKHOUSE_LOCAL`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-local | |
| [`ENABLE_CLICKHOUSE_BENCHMARK`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-benchmark | |
| [`ENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-extract-from-config | |
| [`ENABLE_CLICKHOUSE_COMPRESSOR`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-compressor | |
| [`ENABLE_CLICKHOUSE_COPIER`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-copier | |
| [`ENABLE_CLICKHOUSE_FORMAT`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-format | |
| [`ENABLE_CLICKHOUSE_OBFUSCATOR`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-obfuscator | |
| [`ENABLE_CLICKHOUSE_ODBC_BRIDGE`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-odbc-bridge | |
| [`ENABLE_CLICKHOUSE_INSTALL`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `OFF` | Enable clickhouse-install | |
| [`ENABLE_CLICKHOUSE_INSTALL`](http://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt) | `${ENABLE_CLICKHOUSE_ALL}` | Enable clickhouse-install | |
| [`ENABLE_MULTITARGET_CODE`](http://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt) | `ON` | | |

View File

@ -1,5 +1,7 @@
#!/bin/bash/ #!/bin/bash/
# https://regex101.com/r/R6iogw/7
output_file_name="cmake_flags_and_output.md" output_file_name="cmake_flags_and_output.md"
ch_master_url="http:\/\/github.com\/clickhouse\/clickhouse\/blob\/master\/" ch_master_url="http:\/\/github.com\/clickhouse\/clickhouse\/blob\/master\/"
@ -9,20 +11,28 @@ cat cmake_files_header.md >> ${output_file_name}
process() { process() {
for i in "$1"/*.cmake "$1"/CMakeLists.txt;do for i in "$1"/*.cmake "$1"/CMakeLists.txt;do
if [ -d "$i" ];then
process "$i"
elif [ -f "$i" ]; then
echo "Processing $i" echo "Processing $i"
subd_name=${i//\//\\/} subd_name=${i//\//\\/}
subd_name=${subd_name//\./\\\.} subd_name=${subd_name//\./\\\.}
subd_name=${subd_name:2} subd_name=${subd_name:2}
regex='s/^((\s*#\s+.*\n?)*)\s*option\s*\(([A-Z_]+)\s*(\"((.|\n)*?)\")?\s*(.*)?\).*$/| (`\3`)['$ch_master_url${subd_name:2}'] | `\7` | \5 | \1 |/mg;t;d' regex='s/^((\s*#\s+.*\n?)*)\s*option\s*\(([A-Z_]+)\s*(\"((.|\n)*?)\")?\s*(.*)?\).*$/| [`\3`]('$ch_master_url${subd_name:2}') | `\7` | \5 | \1 |/mg;t;d'
if [ -f $i ]; then
cat $i | sed -E "$regex" >> ${output_file_name} cat $i | sed -E "$regex" >> ${output_file_name}
fi fi
done done
if [ "$2" = true ] ; then
for d in "$1"/*;do
if [ -d "$d" ];then
process $d
fi
done
fi
} }
process ./ false
for base_folder in ./base ./cmake ./programs ./src; do for base_folder in ./base ./cmake ./programs ./src; do
process $base_folder process $base_folder true
done done