summaryrefslogtreecommitdiffstats
path: root/src/zstd/build/cmake/contrib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/zstd/build/cmake/contrib
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/zstd/build/cmake/contrib')
-rw-r--r--src/zstd/build/cmake/contrib/CMakeLists.txt13
-rw-r--r--src/zstd/build/cmake/contrib/gen_html/CMakeLists.txt30
-rw-r--r--src/zstd/build/cmake/contrib/pzstd/CMakeLists.txt32
3 files changed, 75 insertions, 0 deletions
diff --git a/src/zstd/build/cmake/contrib/CMakeLists.txt b/src/zstd/build/cmake/contrib/CMakeLists.txt
new file mode 100644
index 00000000..8c7bc78a
--- /dev/null
+++ b/src/zstd/build/cmake/contrib/CMakeLists.txt
@@ -0,0 +1,13 @@
+# ################################################################
+# 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(contrib)
+
+ADD_SUBDIRECTORY(pzstd)
+ADD_SUBDIRECTORY(gen_html)
diff --git a/src/zstd/build/cmake/contrib/gen_html/CMakeLists.txt b/src/zstd/build/cmake/contrib/gen_html/CMakeLists.txt
new file mode 100644
index 00000000..01d19067
--- /dev/null
+++ b/src/zstd/build/cmake/contrib/gen_html/CMakeLists.txt
@@ -0,0 +1,30 @@
+# ################################################################
+# Copyright (c) 2015-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(gen_html)
+INCLUDE(GetZstdLibraryVersion)
+
+SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
+
+# Define programs directory, where sources and header files are located
+SET(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
+SET(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
+SET(GENHTML_DIR ${ZSTD_SOURCE_DIR}/contrib/gen_html)
+SET(GENHTML_BINARY ${PROJECT_BINARY_DIR}/gen_html${CMAKE_EXECUTABLE_SUFFIX})
+INCLUDE_DIRECTORIES(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${GENHTML_DIR})
+
+ADD_EXECUTABLE(gen_html ${GENHTML_DIR}/gen_html.cpp)
+
+GetZstdLibraryVersion(${LIBRARY_DIR}/zstd.h VMAJOR VMINOR VRELEASE)
+SET(LIBVERSION "${VMAJOR}.${VMINOR}.${VRELEASE}")
+ADD_CUSTOM_TARGET(zstd_manual.html ALL
+ ${GENHTML_BINARY} "${LIBVERSION}" "${LIBRARY_DIR}/zstd.h" "${PROJECT_BINARY_DIR}/zstd_manual.html"
+ DEPENDS gen_html COMMENT "Update zstd manual")
+
+INSTALL(FILES "${PROJECT_BINARY_DIR}/zstd_manual.html" DESTINATION "share/doc")
diff --git a/src/zstd/build/cmake/contrib/pzstd/CMakeLists.txt b/src/zstd/build/cmake/contrib/pzstd/CMakeLists.txt
new file mode 100644
index 00000000..e6db4719
--- /dev/null
+++ b/src/zstd/build/cmake/contrib/pzstd/CMakeLists.txt
@@ -0,0 +1,32 @@
+# ################################################################
+# Copyright (c) 2016-present, 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(pzstd)
+
+SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
+
+# Define programs directory, where sources and header files are located
+SET(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
+SET(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
+SET(PZSTD_DIR ${ZSTD_SOURCE_DIR}/contrib/pzstd)
+INCLUDE_DIRECTORIES(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${PZSTD_DIR})
+
+ADD_EXECUTABLE(pzstd ${PZSTD_DIR}/main.cpp ${PZSTD_DIR}/Options.cpp ${PZSTD_DIR}/Pzstd.cpp ${PZSTD_DIR}/SkippableFrame.cpp)
+SET_PROPERTY(TARGET pzstd APPEND PROPERTY COMPILE_DEFINITIONS "NDEBUG")
+SET_PROPERTY(TARGET pzstd APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow")
+
+SET(THREADS_PREFER_PTHREAD_FLAG ON)
+FIND_PACKAGE(Threads REQUIRED)
+IF (CMAKE_USE_PTHREADS_INIT)
+ TARGET_LINK_LIBRARIES(pzstd libzstd_shared ${CMAKE_THREAD_LIBS_INIT})
+ELSE()
+ MESSAGE(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")
+ENDIF()
+
+INSTALL(TARGETS pzstd RUNTIME DESTINATION "bin")