File: CMakeLists.txt

package info (click to toggle)
mysql-8.0 8.0.43-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,904 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,184; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,196; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (108 lines) | stat: -rw-r--r-- 4,026 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ################################################################
# Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree).
# ################################################################

PROJECT(zstd)
# CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)

SET(ZSTD_SRCS
  ${ZSTD_VERSION_DIR}/lib/common/debug.c
  ${ZSTD_VERSION_DIR}/lib/common/entropy_common.c
  ${ZSTD_VERSION_DIR}/lib/common/error_private.c
  ${ZSTD_VERSION_DIR}/lib/common/fse_decompress.c
  ${ZSTD_VERSION_DIR}/lib/common/pool.c
  ${ZSTD_VERSION_DIR}/lib/common/threading.c
  ${ZSTD_VERSION_DIR}/lib/common/xxhash.c
  ${ZSTD_VERSION_DIR}/lib/common/zstd_common.c

  ${ZSTD_VERSION_DIR}/lib/compress/fse_compress.c
  ${ZSTD_VERSION_DIR}/lib/compress/hist.c
  ${ZSTD_VERSION_DIR}/lib/compress/huf_compress.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_compress.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_compress_literals.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_compress_sequences.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_compress_superblock.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_double_fast.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_fast.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_lazy.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_ldm.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstdmt_compress.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_opt.c
  ${ZSTD_VERSION_DIR}/lib/compress/zstd_preSplit.c

  ${ZSTD_VERSION_DIR}/lib/decompress/huf_decompress.c
  ${ZSTD_VERSION_DIR}/lib/decompress/zstd_ddict.c
  ${ZSTD_VERSION_DIR}/lib/decompress/zstd_decompress_block.c
  ${ZSTD_VERSION_DIR}/lib/decompress/zstd_decompress.c

  ${ZSTD_VERSION_DIR}/lib/dictBuilder/cover.c
  ${ZSTD_VERSION_DIR}/lib/dictBuilder/divsufsort.c
  ${ZSTD_VERSION_DIR}/lib/dictBuilder/fastcover.c
  ${ZSTD_VERSION_DIR}/lib/dictBuilder/zdict.c
)

IF((LINUX AND NOT LINUX_ARM) OR
    (APPLE AND NOT APPLE_ARM))
  ENABLE_LANGUAGE(ASM)
  LIST(APPEND ZSTD_SRCS
    ${ZSTD_VERSION_DIR}/lib/decompress/huf_decompress_amd64.S
    )
ENDIF()

ADD_CONVENIENCE_LIBRARY(zstd
  ${ZSTD_SRCS}
  INCLUDE_DIRECTORIES ${ZSTD_VERSION_DIR}/lib/common
  )

# In case we have OPTIMIZE_DEBUG_BUILDS:BOOL=ON
# This seems to be a gcc12 bug, the combination
# FORCE_INLINE_TEMPLATE and -Og breaks the build.
STRING(REPLACE " -Og " "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")

MY_CHECK_CXX_COMPILER_WARNING("-Wmissing-profile" HAS_MISSING_PROFILE)
IF(HAS_MISSING_PROFILE)
  TARGET_COMPILE_OPTIONS(zstd_objlib PRIVATE ${HAS_MISSING_PROFILE})
ENDIF()

MY_CHECK_CXX_COMPILER_WARNING("-Wdocumentation" HAS_WARN_FLAG)
IF(HAS_WARN_FLAG)
  STRING_APPEND(CMAKE_C_FLAGS " ${HAS_WARN_FLAG}")
ENDIF()

IF(WIN32_CLANG)
  STRING_APPEND(CMAKE_C_FLAGS " -Wno-unused-function")
ENDIF()

#-----------------------------------------------------------------------------
# Add extra compilation flags
#-----------------------------------------------------------------------------
#INCLUDE(AddZstdCompilationFlags)
#ADD_ZSTD_COMPILATION_FLAGS()

# Always hide XXHash symbols
ADD_DEFINITIONS(-DXXH_NAMESPACE=ZSTD_)

#-----------------------------------------------------------------------------
# Options
#-----------------------------------------------------------------------------
OPTION(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
OPTION(ZSTD_MULTITHREAD_SUPPORT "MULTITHREADING SUPPORT" OFF)
OPTION(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON)
OPTION(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF)
OPTION(ZSTD_BUILD_TESTS "BUILD TESTS" OFF)
if (MSVC)
    OPTION(ZSTD_USE_STATIC_RUNTIME "LINK TO STATIC RUN-TIME LIBRARIES" OFF)
endif ()

IF (ZSTD_LEGACY_SUPPORT)
    MESSAGE(STATUS "ZSTD_LEGACY_SUPPORT defined!")
    ADD_DEFINITIONS(-DZSTD_LEGACY_SUPPORT=4)
ELSE (ZSTD_LEGACY_SUPPORT)
    MESSAGE(STATUS "ZSTD_LEGACY_SUPPORT not defined!")
    ADD_DEFINITIONS(-DZSTD_LEGACY_SUPPORT=0)
ENDIF (ZSTD_LEGACY_SUPPORT)