ClickHouse/libs/libcommon/CMakeLists.txt

91 lines
2.3 KiB
CMake
Raw Normal View History

include_directories (include)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libcctz/include)
2017-01-21 02:32:02 +00:00
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
2016-02-07 21:58:58 +00:00
if (APPLE)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_VERSION}" VERSION_LESS "16.1.0")
set (APPLE_SIERRA_OR_NEWER 1)
else ()
set (APPLE_SIERRA_OR_NEWER 0)
endif ()
endif ()
set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/common/config_common.h.in ${CONFIG_COMMON})
if (APPLE)
add_library (apple_rt
src/apple_rt.cpp
include/common/apple_rt.h
)
endif ()
2016-02-07 21:58:58 +00:00
add_library (common
src/DateLUT.cpp
src/DateLUTImpl.cpp
src/exp10.cpp
2016-02-07 21:58:58 +00:00
src/JSON.cpp
include/common/ApplicationServerExt.h
include/common/Common.h
include/common/DateLUT.h
include/common/DateLUTImpl.h
include/common/LocalDate.h
include/common/LocalDateTime.h
include/common/ErrorHandlers.h
include/common/exp10.h
2016-02-07 21:58:58 +00:00
include/common/likely.h
include/common/logger_useful.h
include/common/MultiVersion.h
include/common/singleton.h
include/common/strong_typedef.h
include/common/JSON.h
include/ext/bit_cast.hpp
include/ext/collection_cast.hpp
include/ext/enumerate.hpp
include/ext/function_traits.hpp
include/ext/identity.hpp
include/ext/map.hpp
include/ext/range.hpp
include/ext/scope_guard.hpp
include/ext/size.hpp
include/ext/unlock_guard.hpp
${CONFIG_COMMON}
2016-02-07 21:58:58 +00:00
)
# When testing for memory leaks, dont link tcmalloc or jemalloc.
if (USE_JEMALLOC)
message (STATUS "Link jemalloc : ${JEMALLOC_LIBRARIES}")
set (MALLOC_LIBRARIES ${JEMALLOC_LIBRARIES})
elseif (USE_TCMALLOC)
2016-12-01 22:44:59 +00:00
if (DEBUG_LIBTCMALLOC)
message (STATUS "Link libtcmalloc_minimal_debug for testing: ${GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG}")
set (MALLOC_LIBRARIES ${GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG})
2016-12-01 22:44:59 +00:00
else ()
message (STATUS "Link libtcmalloc_minimal : ${GPERFTOOLS_TCMALLOC_MINIMAL}")
set (MALLOC_LIBRARIES ${GPERFTOOLS_TCMALLOC_MINIMAL})
2016-12-01 22:44:59 +00:00
endif ()
else ()
message (STATUS "Disabling libtcmalloc for valgrind better analysis")
endif ()
2016-02-07 21:58:58 +00:00
2017-01-11 13:40:02 +00:00
find_package (Threads)
2016-05-28 00:16:28 +00:00
target_link_libraries (
common
pocoext
2017-01-21 02:32:02 +00:00
cctz
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
2016-05-28 00:16:28 +00:00
${MALLOC_LIBRARIES}
2017-01-11 13:40:02 +00:00
${CMAKE_THREAD_LIBS_INIT}
${RT_LIBRARIES})
2016-05-28 00:16:28 +00:00
2016-12-01 22:44:59 +00:00
if (ENABLE_TESTS)
2016-02-07 21:58:58 +00:00
add_subdirectory (src/tests)
2016-12-01 22:44:59 +00:00
endif (ENABLE_TESTS)