diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 145015ad0f2..851c276cd10 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,18 @@ if (COMPILER_GCC) add_definitions ("-fno-tree-loop-distribute-patterns") endif () +# ClickHouse developers may use platform-dependent code under some macro (e.g. `#ifdef ENABLE_MULTITARGET`). +# If turned ON, this option defines such macro. +# See `src/Common/TargetSpecific.h` +option(ENABLE_MULTITARGET_CODE "Enable platform-dependent code" ON) + +if (ENABLE_MULTITARGET_CODE) + add_definitions(-DENABLE_MULTITARGET_CODE=1) +else() + add_definitions(-DENABLE_MULTITARGET_CODE=0) +endif() + + add_subdirectory (Access) add_subdirectory (Backups) add_subdirectory (Columns) diff --git a/src/Functions/TargetSpecific.cpp b/src/Common/TargetSpecific.cpp similarity index 96% rename from src/Functions/TargetSpecific.cpp rename to src/Common/TargetSpecific.cpp index 830611fea7a..43319eff44b 100644 --- a/src/Functions/TargetSpecific.cpp +++ b/src/Common/TargetSpecific.cpp @@ -1,4 +1,4 @@ -#include +#include #include diff --git a/src/Functions/TargetSpecific.h b/src/Common/TargetSpecific.h similarity index 100% rename from src/Functions/TargetSpecific.h rename to src/Common/TargetSpecific.h diff --git a/src/Functions/CMakeLists.txt b/src/Functions/CMakeLists.txt index 2596b10503f..debe7fac8a5 100644 --- a/src/Functions/CMakeLists.txt +++ b/src/Functions/CMakeLists.txt @@ -96,17 +96,6 @@ if (TARGET ch_contrib::rapidjson) target_link_libraries(clickhouse_functions PRIVATE ch_contrib::rapidjson) endif() -# ClickHouse developers may use platform-dependent code under some macro (e.g. `#ifdef ENABLE_MULTITARGET`). -# If turned ON, this option defines such macro. -# See `src/Functions/TargetSpecific.h` -option(ENABLE_MULTITARGET_CODE "Enable platform-dependent code" ON) - -if (ENABLE_MULTITARGET_CODE) - add_definitions(-DENABLE_MULTITARGET_CODE=1) -else() - add_definitions(-DENABLE_MULTITARGET_CODE=0) -endif() - add_subdirectory(GatherUtils) target_link_libraries(clickhouse_functions PRIVATE clickhouse_functions_gatherutils) diff --git a/src/Functions/FunctionStartsEndsWith.h b/src/Functions/FunctionStartsEndsWith.h index bbe1631fdf9..f6e0d6375c6 100644 --- a/src/Functions/FunctionStartsEndsWith.h +++ b/src/Functions/FunctionStartsEndsWith.h @@ -1,12 +1,12 @@ #pragma once #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/src/Functions/FunctionsHashing.h b/src/Functions/FunctionsHashing.h index 88a0e9524b3..b78ecb5c72a 100644 --- a/src/Functions/FunctionsHashing.h +++ b/src/Functions/FunctionsHashing.h @@ -38,8 +38,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/Functions/FunctionsRandom.h b/src/Functions/FunctionsRandom.h index 2dacd6d6db9..937bc9d36dd 100644 --- a/src/Functions/FunctionsRandom.h +++ b/src/Functions/FunctionsRandom.h @@ -1,9 +1,9 @@ #pragma once +#include #include #include #include -#include #include #include diff --git a/src/Functions/GatherUtils/sliceHasImplAnyAll.h b/src/Functions/GatherUtils/sliceHasImplAnyAll.h index ec8daceb990..68f31006b4f 100644 --- a/src/Functions/GatherUtils/sliceHasImplAnyAll.h +++ b/src/Functions/GatherUtils/sliceHasImplAnyAll.h @@ -14,7 +14,8 @@ #include #endif -#include +#include + namespace DB::GatherUtils { diff --git a/src/Functions/PerformanceAdaptors.h b/src/Functions/PerformanceAdaptors.h index bcc195e988e..5b690d83805 100644 --- a/src/Functions/PerformanceAdaptors.h +++ b/src/Functions/PerformanceAdaptors.h @@ -1,8 +1,8 @@ #pragma once -#include #include +#include #include #include diff --git a/src/Functions/greatCircleDistance.cpp b/src/Functions/greatCircleDistance.cpp index f0743486584..9b0d2625914 100644 --- a/src/Functions/greatCircleDistance.cpp +++ b/src/Functions/greatCircleDistance.cpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include