]> git.proxmox.com Git - ceph.git/blob - ceph/src/zstd/build/cmake/tests/CMakeLists.txt
import 15.2.0 Octopus source
[ceph.git] / ceph / src / zstd / build / cmake / tests / CMakeLists.txt
1 # ################################################################
2 # zstd - Makefile
3 # Copyright (C) Yann Collet 2014-present
4 # All rights reserved.
5 #
6 # BSD license
7 #
8 # Redistribution and use in source and binary forms, with or without modification,
9 # are permitted provided that the following conditions are met:
10 #
11 # * Redistributions of source code must retain the above copyright notice, this
12 # list of conditions and the following disclaimer.
13 #
14 # * Redistributions in binary form must reproduce the above copyright notice, this
15 # list of conditions and the following disclaimer in the documentation and/or
16 # other materials provided with the distribution.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #
29 # You can contact the author at :
30 # - zstd homepage : http://www.zstd.net/
31 # ################################################################
32
33 project(tests)
34
35 set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
36
37 # Define programs directory, where sources and header files are located
38 set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
39 set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
40 set(TESTS_DIR ${ZSTD_SOURCE_DIR}/tests)
41 include_directories(${TESTS_DIR} ${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/compress ${LIBRARY_DIR}/dictBuilder)
42
43 add_executable(datagen ${PROGRAMS_DIR}/datagen.c ${TESTS_DIR}/datagencli.c)
44 target_link_libraries(datagen libzstd_static)
45
46 add_executable(fullbench ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${TESTS_DIR}/fullbench.c)
47 target_link_libraries(fullbench libzstd_static)
48
49 add_executable(fuzzer ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/fuzzer.c)
50 target_link_libraries(fuzzer libzstd_static)
51
52 if (UNIX)
53 add_executable(paramgrill ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/paramgrill.c)
54 target_link_libraries(paramgrill libzstd_static m) #m is math library
55 endif ()