From 2da72151470887f7e40a9c5a1ac628896b81da81 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Fri, 30 Apr 2021 10:31:12 +0300 Subject: [PATCH] Fix build --- cmake/find/llvm.cmake | 2 +- src/CMakeLists.txt | 4 ---- src/Interpreters/JIT/CHJIT.cpp | 4 ++++ src/Interpreters/JIT/CHJIT.h | 8 ++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cmake/find/llvm.cmake b/cmake/find/llvm.cmake index 6ea7a5fd68..e08f45b993 100644 --- a/cmake/find/llvm.cmake +++ b/cmake/find/llvm.cmake @@ -2,7 +2,7 @@ if (APPLE OR SPLIT_SHARED_LIBRARIES OR NOT ARCH_AMD64) set (ENABLE_EMBEDDED_COMPILER OFF CACHE INTERNAL "") endif() -option (ENABLE_EMBEDDED_COMPILER "Set to TRUE to enable support for 'compile_expressions' option for query execution" ${ENABLE_LIBRARIES}) +option (ENABLE_EMBEDDED_COMPILER "Enable support for 'compile_expressions' option for query execution" ON) # Broken in macos. TODO: update clang, re-test, enable on Apple if (ENABLE_EMBEDDED_COMPILER AND NOT SPLIT_SHARED_LIBRARIES AND ARCH_AMD64 AND NOT (SANITIZE STREQUAL "undefined")) option (USE_INTERNAL_LLVM_LIBRARY "Use bundled or system LLVM library." ${NOT_UNBUNDLED}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0f7f5ae12f..292adc0e12 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -249,10 +249,6 @@ endmacro () dbms_target_include_directories (PUBLIC "${ClickHouse_SOURCE_DIR}/src" "${ClickHouse_BINARY_DIR}/src") target_include_directories (clickhouse_common_io PUBLIC "${ClickHouse_SOURCE_DIR}/src" "${ClickHouse_BINARY_DIR}/src") -if (NOT DEFINED USE_EMBEDDED_COMPILER) - set (USE_EMBEDDED_COMPILER ON) -endif () - if (USE_EMBEDDED_COMPILER) dbms_target_link_libraries (PRIVATE ${REQUIRED_LLVM_LIBRARIES}) dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${LLVM_INCLUDE_DIRS}) diff --git a/src/Interpreters/JIT/CHJIT.cpp b/src/Interpreters/JIT/CHJIT.cpp index 4a7d014690..402ebd2dba 100644 --- a/src/Interpreters/JIT/CHJIT.cpp +++ b/src/Interpreters/JIT/CHJIT.cpp @@ -1,5 +1,7 @@ #include "CHJIT.h" +#if USE_EMBEDDED_COMPILER + #include #include #include @@ -331,3 +333,5 @@ std::unique_ptr CHJIT::getTargetMachine() } } + +#endif diff --git a/src/Interpreters/JIT/CHJIT.h b/src/Interpreters/JIT/CHJIT.h index 89c05d5e1d..704bdffebb 100644 --- a/src/Interpreters/JIT/CHJIT.h +++ b/src/Interpreters/JIT/CHJIT.h @@ -1,5 +1,11 @@ #pragma once +#if !defined(ARCADIA_BUILD) +# include "config_core.h" +#endif + +#if USE_EMBEDDED_COMPILER + #include #include @@ -68,3 +74,5 @@ private: }; } + +#endif