contrib: cctz as submodule. update cctz.

This commit is contained in:
proller 2017-11-02 21:55:52 +03:00 committed by alexey-milovidov
parent a4636f8656
commit 702c68959a
6 changed files with 42 additions and 29 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "contrib/librdkafka"]
path = contrib/librdkafka
url = https://github.com/edenhill/librdkafka.git
[submodule "contrib/cctz"]
path = contrib/cctz
url = https://github.com/google/cctz.git

View File

@ -49,7 +49,7 @@ if (USE_INTERNAL_ZLIB_LIBRARY)
endif ()
if (USE_INTERNAL_CCTZ_LIBRARY)
add_subdirectory (libcctz)
add_subdirectory (cctz-cmake)
endif ()
if (ENABLE_LIBTCMALLOC AND USE_INTERNAL_GPERFTOOLS_LIBRARY)

1
contrib/cctz vendored Submodule

@ -0,0 +1 @@
Subproject commit 4f9776a310f4952454636363def82c2bf6641d5f

View File

@ -0,0 +1,31 @@
SET(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz)
add_library(cctz
${LIBRARY_DIR}/src/civil_time_detail.cc
${LIBRARY_DIR}/src/time_zone_fixed.cc
${LIBRARY_DIR}/src/time_zone_format.cc
${LIBRARY_DIR}/src/time_zone_if.cc
${LIBRARY_DIR}/src/time_zone_impl.cc
${LIBRARY_DIR}/src/time_zone_info.cc
${LIBRARY_DIR}/src/time_zone_libc.cc
${LIBRARY_DIR}/src/time_zone_lookup.cc
${LIBRARY_DIR}/src/time_zone_posix.cc
${LIBRARY_DIR}/src/zone_info_source.cc
${LIBRARY_DIR}/src/time_zone_libc.h
${LIBRARY_DIR}/src/time_zone_if.h
${LIBRARY_DIR}/src/tzfile.h
${LIBRARY_DIR}/src/time_zone_impl.h
${LIBRARY_DIR}/src/time_zone_posix.h
${LIBRARY_DIR}/src/time_zone_info.h
${LIBRARY_DIR}/include/cctz/time_zone.h
${LIBRARY_DIR}/include/cctz/civil_time_detail.h
${LIBRARY_DIR}/include/cctz/civil_time.h)
if (CMAKE_SYSTEM MATCHES "FreeBSD")
# yes, need linux, because bsd check inside linux in time_zone_libc.cc:24
target_compile_definitions (cctz PRIVATE __USE_BSD linux _XOPEN_SOURCE=600)
endif ()
target_include_directories (cctz PUBLIC ${LIBRARY_DIR}/include)

View File

@ -1,27 +0,0 @@
add_library(cctz
src/time_zone_libc.cc
src/time_zone_posix.cc
src/time_zone_lookup.cc
src/time_zone_info.cc
src/time_zone_if.cc
src/time_zone_format.cc
src/time_zone_impl.cc
src/time_zone_libc.h
src/time_zone_if.h
src/tzfile.h
src/time_zone_impl.h
src/time_zone_posix.h
src/time_zone_info.h
include/time_zone.h
include/civil_time_detail.h
include/civil_time.h)
if (CMAKE_SYSTEM MATCHES "FreeBSD")
# yes, need linux, because bsd check inside linux in time_zone_libc.cc:24
target_compile_definitions (cctz PRIVATE __USE_BSD linux _XOPEN_SOURCE=600)
endif ()
target_include_directories (cctz PUBLIC include)

View File

@ -1,5 +1,10 @@
option (USE_INTERNAL_CCTZ_LIBRARY "Set to FALSE to use system cctz library instead of bundled" ${NOT_UNBUNDLED})
if (USE_INTERNAL_CCTZ_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz/time_zone.h")
message (WARNING "submodule contrib/cctz is missing. to fix try run: \n git submodule update --init --recursive")
set (USE_INTERNAL_CCTZ_LIBRARY 0)
endif ()
if (NOT USE_INTERNAL_CCTZ_LIBRARY)
find_library (CCTZ_LIBRARY cctz)
find_path (CCTZ_INCLUDE_DIR NAMES civil_time.h PATHS ${CCTZ_INCLUDE_PATHS})
@ -8,7 +13,7 @@ endif ()
if (CCTZ_LIBRARY AND CCTZ_INCLUDE_DIR)
else ()
set (USE_INTERNAL_CCTZ_LIBRARY 1)
set (CCTZ_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libcctz/include")
set (CCTZ_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz")
set (CCTZ_LIBRARY cctz)
endif ()