2017-03-02 13:34:43 +00:00
|
|
|
|
2018-08-05 08:54:57 +00:00
|
|
|
if (OS_FREEBSD)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (PATH_SHARE "/usr/local/share" CACHE STRING "")
|
2017-03-02 13:34:43 +00:00
|
|
|
else ()
|
2017-04-01 07:20:54 +00:00
|
|
|
set (PATH_SHARE "/usr/share" CACHE STRING "")
|
2017-03-02 13:34:43 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-06-04 20:26:17 +00:00
|
|
|
set (INTERNAL_COMPILER_BIN_ROOT "${CMAKE_INSTALL_FULL_BINDIR}/" CACHE STRING "")
|
|
|
|
set (INTERNAL_COMPILER_EXECUTABLE "clickhouse-clang" CACHE STRING "")
|
|
|
|
set (INTERNAL_LINKER_EXECUTABLE "clickhouse-lld" CACHE STRING "")
|
2018-01-18 14:10:21 +00:00
|
|
|
|
2018-09-02 19:49:12 +00:00
|
|
|
# Disabling leak reporting for these tools
|
2018-08-30 19:27:36 +00:00
|
|
|
if (SANITIZE STREQUAL "address")
|
2018-09-02 19:49:12 +00:00
|
|
|
# Note that this doesn't work for setuid and setcap binaries
|
2018-02-12 14:57:25 +00:00
|
|
|
set(INTERNAL_COMPILER_ENV "env ASAN_OPTIONS=detect_leaks=0" CACHE STRING "")
|
|
|
|
else ()
|
|
|
|
set(INTERNAL_COMPILER_ENV "" CACHE STRING "")
|
2018-01-18 14:10:21 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-12-29 15:48:20 +00:00
|
|
|
set (INTERNAL_COMPILER_NO_WARNING OFF CACHE INTERNAL "")
|
2018-08-10 22:59:32 +00:00
|
|
|
set (INTERNAL_COMPILER_HEADERS_DIR "headers" CACHE STRING "")
|
|
|
|
set (INTERNAL_COMPILER_HEADERS_RELATIVE "${INTERNAL_COMPILER_HEADERS_DIR}/${VERSION_STRING}" CACHE STRING "")
|
2018-08-10 19:53:49 +00:00
|
|
|
set (INTERNAL_COMPILER_HEADERS "${PATH_SHARE}/clickhouse/${INTERNAL_COMPILER_HEADERS_RELATIVE}" CACHE STRING "")
|
2017-12-11 15:12:35 +00:00
|
|
|
set (INTERNAL_COMPILER_HEADERS_ROOT "${INTERNAL_COMPILER_HEADERS}" CACHE STRING "")
|
2018-01-09 17:49:25 +00:00
|
|
|
set (INTERNAL_COMPILER_CUSTOM_ROOT ON CACHE INTERNAL "")
|
2017-03-02 13:34:43 +00:00
|
|
|
|
2018-02-13 18:01:59 +00:00
|
|
|
set (INTERNAL_COMPILER_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UC}} ${CXX_FLAGS_INTERNAL_COMPILER} -x c++ -march=native -fPIC -fvisibility=hidden -fno-implement-inlines -nostdinc -nostdinc++ -Wno-unused-command-line-argument -Bprefix=${PATH_SHARE}/clickhouse -isysroot=${INTERNAL_COMPILER_HEADERS_ROOT}" CACHE STRING "")
|
2018-06-04 20:26:17 +00:00
|
|
|
# TODO: use libs from package: -nodefaultlibs -lm -lc -lgcc_s -lgcc -lc++ -lc++abi
|
|
|
|
|
2018-09-05 18:50:17 +00:00
|
|
|
string(REPLACE "${INCLUDE_DEBUG_HELPERS}" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
2017-03-02 13:34:43 +00:00
|
|
|
string(REPLACE "-no-pie" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
|
|
|
if (INTERNAL_COMPILER_NO_WARNING)
|
2017-04-01 07:20:54 +00:00
|
|
|
string (REPLACE "-Wall" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
2017-12-25 16:01:03 +00:00
|
|
|
string (REPLACE "-Wextra" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
2017-04-01 07:20:54 +00:00
|
|
|
string (REPLACE "-Werror" "" INTERNAL_COMPILER_FLAGS ${INTERNAL_COMPILER_FLAGS})
|
2017-03-02 13:34:43 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
list(GET Poco_INCLUDE_DIRS 0 Poco_Foundation_INCLUDE_DIR)
|
|
|
|
list(GET Poco_INCLUDE_DIRS 1 Poco_Util_INCLUDE_DIR)
|
|
|
|
|
2017-08-09 20:52:55 +00:00
|
|
|
if (NOT DOUBLE_CONVERSION_INCLUDE_DIR)
|
|
|
|
get_target_property(DOUBLE_CONVERSION_INCLUDE_DIR ${DOUBLE_CONVERSION_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
endif ()
|
|
|
|
|
2018-06-04 20:26:17 +00:00
|
|
|
string (REPLACE ${ClickHouse_SOURCE_DIR} "" INTERNAL_DOUBLE_CONVERSION_INCLUDE_DIR ${DOUBLE_CONVERSION_INCLUDE_DIR})
|
|
|
|
string (REPLACE ${ClickHouse_SOURCE_DIR} "" INTERNAL_Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
|
|
|
|
string (REPLACE ${ClickHouse_SOURCE_DIR} "" INTERNAL_Poco_Foundation_INCLUDE_DIR ${Poco_Foundation_INCLUDE_DIR})
|
|
|
|
string (REPLACE ${ClickHouse_SOURCE_DIR} "" INTERNAL_Poco_Util_INCLUDE_DIR ${Poco_Util_INCLUDE_DIR})
|
2017-03-02 13:34:43 +00:00
|
|
|
|
2018-09-05 18:50:17 +00:00
|
|
|
message (STATUS "Using internal=${USE_INTERNAL_LLVM_LIBRARY} compiler=${USE_EMBEDDED_COMPILER}: headers=${INTERNAL_COMPILER_HEADERS} : ${INTERNAL_COMPILER_ENV} ${INTERNAL_COMPILER_BIN_ROOT}${INTERNAL_COMPILER_EXECUTABLE} ${INTERNAL_COMPILER_FLAGS}; ${INTERNAL_LINKER_EXECUTABLE}")
|
2017-03-02 13:34:43 +00:00
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
set (CONFIG_COMPILE ${ClickHouse_BINARY_DIR}/dbms/src/Interpreters/config_compile.h)
|
|
|
|
configure_file (${ClickHouse_SOURCE_DIR}/dbms/src/Interpreters/config_compile.h.in ${CONFIG_COMPILE})
|
2017-03-02 13:34:43 +00:00
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
if (ENABLE_TESTS)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_subdirectory (tests)
|
2017-04-10 17:43:30 +00:00
|
|
|
endif ()
|