ClickHouse/contrib/zstd-cmake/CMakeLists.txt

155 lines
6.9 KiB
CMake
Raw Normal View History

2016-10-25 07:14:12 +00:00
# ################################################################
# zstd - Makefile
# Copyright (C) Yann Collet 2014-2016
# All rights reserved.
#
# BSD license
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# You can contact the author at :
# - zstd homepage : http://www.zstd.net/
# ################################################################
# Get library version based on information from input content (use regular exp)
function(GetLibraryVersion _content _outputVar1 _outputVar2 _outputVar3)
string(REGEX MATCHALL ".*define ZSTD_VERSION_MAJOR+.* ([0-9]+).*define ZSTD_VERSION_MINOR+.* ([0-9]+).*define ZSTD_VERSION_RELEASE+.* ([0-9]+)" VERSION_REGEX "${_content}")
SET(${_outputVar1} ${CMAKE_MATCH_1} PARENT_SCOPE)
SET(${_outputVar2} ${CMAKE_MATCH_2} PARENT_SCOPE)
SET(${_outputVar3} ${CMAKE_MATCH_3} PARENT_SCOPE)
endfunction()
# Define library directory, where sources and header files are located
SET(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib")
INCLUDE_DIRECTORIES(BEFORE ${LIBRARY_DIR} "${LIBRARY_DIR}/common")
2016-10-25 07:14:12 +00:00
# Read file content
FILE(READ "${LIBRARY_DIR}/zstd.h" HEADER_CONTENT)
2016-10-25 07:14:12 +00:00
# Parse version
GetLibraryVersion("${HEADER_CONTENT}" LIBVER_MAJOR LIBVER_MINOR LIBVER_RELEASE)
MESSAGE(STATUS "ZSTD VERSION ${LIBVER_MAJOR}.${LIBVER_MINOR}.${LIBVER_RELEASE}")
2016-10-25 07:14:12 +00:00
2020-05-04 17:46:10 +00:00
# cd contrib/zstd/lib
# find . -name '*.c' | grep -vP 'deprecated|legacy' | sort | sed 's/^\./ "${LIBRARY_DIR}/"'
2016-10-25 07:14:12 +00:00
SET(Sources
"${LIBRARY_DIR}/common/debug.c"
"${LIBRARY_DIR}/common/entropy_common.c"
"${LIBRARY_DIR}/common/error_private.c"
"${LIBRARY_DIR}/common/fse_decompress.c"
"${LIBRARY_DIR}/common/pool.c"
"${LIBRARY_DIR}/common/threading.c"
"${LIBRARY_DIR}/common/xxhash.c"
"${LIBRARY_DIR}/common/zstd_common.c"
"${LIBRARY_DIR}/compress/fse_compress.c"
"${LIBRARY_DIR}/compress/hist.c"
"${LIBRARY_DIR}/compress/huf_compress.c"
"${LIBRARY_DIR}/compress/zstd_compress.c"
"${LIBRARY_DIR}/compress/zstd_compress_literals.c"
"${LIBRARY_DIR}/compress/zstd_compress_sequences.c"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/compress/zstd_compress_superblock.c"
"${LIBRARY_DIR}/compress/zstd_double_fast.c"
"${LIBRARY_DIR}/compress/zstd_fast.c"
"${LIBRARY_DIR}/compress/zstd_lazy.c"
"${LIBRARY_DIR}/compress/zstd_ldm.c"
"${LIBRARY_DIR}/compress/zstdmt_compress.c"
"${LIBRARY_DIR}/compress/zstd_opt.c"
"${LIBRARY_DIR}/decompress/huf_decompress.c"
"${LIBRARY_DIR}/decompress/zstd_ddict.c"
"${LIBRARY_DIR}/decompress/zstd_decompress_block.c"
"${LIBRARY_DIR}/decompress/zstd_decompress.c"
"${LIBRARY_DIR}/dictBuilder/cover.c"
"${LIBRARY_DIR}/dictBuilder/divsufsort.c"
"${LIBRARY_DIR}/dictBuilder/fastcover.c"
"${LIBRARY_DIR}/dictBuilder/zdict.c")
2016-10-25 07:14:12 +00:00
2020-05-04 17:46:10 +00:00
# cd contrib/zstd/lib
# find . -name '*.h' | grep -vP 'deprecated|legacy' | sort | sed 's/^\./ "${LIBRARY_DIR}/"'
2016-10-25 07:14:12 +00:00
SET(Headers
"${LIBRARY_DIR}/common/bitstream.h"
"${LIBRARY_DIR}/common/compiler.h"
"${LIBRARY_DIR}/common/cpu.h"
"${LIBRARY_DIR}/common/debug.h"
"${LIBRARY_DIR}/common/error_private.h"
"${LIBRARY_DIR}/common/fse.h"
"${LIBRARY_DIR}/common/huf.h"
"${LIBRARY_DIR}/common/mem.h"
"${LIBRARY_DIR}/common/pool.h"
"${LIBRARY_DIR}/common/threading.h"
"${LIBRARY_DIR}/common/xxhash.h"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/common/zstd_deps.h"
"${LIBRARY_DIR}/common/zstd_internal.h"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/common/zstd_trace.h"
"${LIBRARY_DIR}/compress/hist.h"
"${LIBRARY_DIR}/compress/zstd_compress_internal.h"
"${LIBRARY_DIR}/compress/zstd_compress_literals.h"
"${LIBRARY_DIR}/compress/zstd_compress_sequences.h"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/compress/zstd_compress_superblock.h"
"${LIBRARY_DIR}/compress/zstd_cwksp.h"
"${LIBRARY_DIR}/compress/zstd_double_fast.h"
"${LIBRARY_DIR}/compress/zstd_fast.h"
"${LIBRARY_DIR}/compress/zstd_lazy.h"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/compress/zstd_ldm_geartab.h"
"${LIBRARY_DIR}/compress/zstd_ldm.h"
"${LIBRARY_DIR}/compress/zstdmt_compress.h"
"${LIBRARY_DIR}/compress/zstd_opt.h"
"${LIBRARY_DIR}/decompress/zstd_ddict.h"
"${LIBRARY_DIR}/decompress/zstd_decompress_block.h"
"${LIBRARY_DIR}/decompress/zstd_decompress_internal.h"
"${LIBRARY_DIR}/dictBuilder/cover.h"
"${LIBRARY_DIR}/dictBuilder/divsufsort.h"
2021-05-14 22:57:24 +00:00
"${LIBRARY_DIR}/zdict.h"
"${LIBRARY_DIR}/zstd_errors.h"
"${LIBRARY_DIR}/zstd.h")
2016-10-25 07:14:12 +00:00
SET(ZSTD_LEGACY_SUPPORT true)
IF (ZSTD_LEGACY_SUPPORT)
SET(LIBRARY_LEGACY_DIR "${LIBRARY_DIR}/legacy")
INCLUDE_DIRECTORIES(BEFORE ${LIBRARY_LEGACY_DIR})
2016-10-25 07:14:12 +00:00
ADD_DEFINITIONS(-D ZSTD_LEGACY_SUPPORT=1)
SET(Sources ${Sources}
"${LIBRARY_LEGACY_DIR}/zstd_v01.c"
"${LIBRARY_LEGACY_DIR}/zstd_v02.c"
"${LIBRARY_LEGACY_DIR}/zstd_v03.c"
"${LIBRARY_LEGACY_DIR}/zstd_v04.c"
"${LIBRARY_LEGACY_DIR}/zstd_v05.c"
"${LIBRARY_LEGACY_DIR}/zstd_v06.c"
"${LIBRARY_LEGACY_DIR}/zstd_v07.c")
2016-10-25 07:14:12 +00:00
SET(Headers ${Headers}
"${LIBRARY_LEGACY_DIR}/zstd_legacy.h"
"${LIBRARY_LEGACY_DIR}/zstd_v01.h"
"${LIBRARY_LEGACY_DIR}/zstd_v02.h"
"${LIBRARY_LEGACY_DIR}/zstd_v03.h"
"${LIBRARY_LEGACY_DIR}/zstd_v04.h"
"${LIBRARY_LEGACY_DIR}/zstd_v05.h"
"${LIBRARY_LEGACY_DIR}/zstd_v06.h"
"${LIBRARY_LEGACY_DIR}/zstd_v07.h")
2016-10-25 07:14:12 +00:00
ENDIF (ZSTD_LEGACY_SUPPORT)
ADD_LIBRARY(zstd ${Sources} ${Headers})
zstd, lz4 as submodule (#1214) * Contrib: use zstd, lz4 as submodule * fix shared build * re-test me. * wip * Update CHANGELOG_RU.md * Update CHANGELOG.md * Update CHANGELOG_RU.md * Whitespaces [#CLICKHOUSE-2]. * Implemented TODO [#CLICKHOUSE-2]. * Whitespaces [#CLICKHOUSE-2]. * Remove wrong test * Implemented TODO [#CLICKHOUSE-2]. * Moved chown to correct place [#CLICKHOUSE-2]. * Resolves #1273. Exception safe users update. [#CLICKHOUSE-3] * Less noisy logging. [#CLICKHOSUE-2] * Add metrics for RWLockFIFO. [#CLICKHOUSE-3246] * Executable dictionaries: fail if program returns non zero exit code (#CLICKHOUSE-3171) * Add better logging if OPTIMIZE cannot be executed. [#CLICKHOUSE-2] * test me * Fixing documentation fragment about "default" user. It is not mandatory anymore. * append yurial/clickhouse-client to docs/interfaces * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Update MergeTreeDataMerger.cpp * Update ShellCommand.cpp * Disable part sendings and fetches before ALTER. [#CLICKHOUSE-3343] * Update ExecutableDictionarySource.cpp * Update ExecutableDictionarySource.cpp * Miscellaneous changes after merge [#CLICKHOUSE-2]. * Improve tests: allow redefine some values (clickhouse path, ports, ...) * Received signal Segmentation fault (#1300) (#1302) * Received signal Segmentation fault (#1300) * Add test * Tests: Use new possibly redefined values from env (in 2 tests) * Proper fix for the issue: better exception message [#CLICKHOUSE-2]. * Split GatherUtils.cpp for faster compile (#1312) * Split GatherUtils.cpp for faster compile * remove GatherUtils.cpp * Fix array writing (#1314) * changed MergedBlockOutputStream [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * disabled checkNoMultidimensionalArrays [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * fix IMergedBlockOutputStream::writeDataImpl [#CLICKHOUSE-3341] * added test [#CLICKHOUSE-3341] * fixed test [#CLICKHOUSE-3341] * refactoring and comments [#CLICKHOUSE-3341] * fix build [#CLICKHOUSE-3341] * Update ColumnArray.h * Update ActionBlocker.h * Fix section tabulation * Fixed infinite recursion in expression analyzer. [#CLICKHOUSE-3125] * Update ActionBlocker.h * Improvement [#CLICKHOUSE-2]. * Try fix strange terminate (#1329) * Tests: External: rename --use_http => --no_http and fix * Try fix strange terminate * Misc [#CLICKHOUSE-2]. * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) (#1333) * Fix compile with boost 1.65.1+ and clang 3.8 ( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222439 ) * Fix compile CallPointInPolygon on clang4 (Thanks to @vavrusa) * Fix complex queries with GLOBAL IN and UNION ALL (#CLICKHOUSE-3356) (#1339) * TEST only: why initQueryAnalyzer ? * Better tests * missing file * Missing file * Add test * Test fixes * Fixed FREEZE PARTITION: using only active data parts; acquire snapshot of parts [#CLICKHOUSE-3369]. * Removed tcp_ssl_port by default [#CLICKHOUSE-2]. * Better tests * comment * clean * REmove wrong code * clean * dbms: Added compression level for ZSTD. [#METR-26742] * dbms: CompressionSettingsSelector. [#METR-21516] * dbms: Minor fix. [#METR-21516] * Fix SummingMergeTree argument checking logic. This patch fixes the Nested Column Name checking logic, which allows nested columns be explicitly specified in SummingMergeTree engine.
2017-10-13 18:52:23 +00:00
target_include_directories (zstd PUBLIC ${LIBRARY_DIR})
2020-05-03 19:27:12 +00:00
target_compile_options(zstd PRIVATE -fno-sanitize=undefined)