2016-08-18 12:42:28 +00:00
|
|
|
# ################################################################
|
|
|
|
# zstd - Makefile
|
2018-06-13 23:49:31 +00:00
|
|
|
# Copyright (C) Yann Collet 2014-present
|
2016-08-18 12:42:28 +00:00
|
|
|
# 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/
|
|
|
|
# ################################################################
|
|
|
|
|
2018-12-23 01:31:59 +00:00
|
|
|
project(tests)
|
2016-08-18 12:42:28 +00:00
|
|
|
|
2018-12-23 01:31:59 +00:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
|
2016-08-18 12:42:28 +00:00
|
|
|
|
|
|
|
# Define programs directory, where sources and header files are located
|
2018-12-23 01:31:59 +00:00
|
|
|
set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
|
|
|
|
set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
|
|
|
|
set(TESTS_DIR ${ZSTD_SOURCE_DIR}/tests)
|
|
|
|
include_directories(${TESTS_DIR} ${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/compress ${LIBRARY_DIR}/dictBuilder)
|
2016-08-18 12:42:28 +00:00
|
|
|
|
2018-12-23 01:31:59 +00:00
|
|
|
add_executable(datagen ${PROGRAMS_DIR}/datagen.c ${TESTS_DIR}/datagencli.c)
|
|
|
|
target_link_libraries(datagen libzstd_static)
|
2018-10-05 00:25:11 +00:00
|
|
|
|
2019-04-11 00:47:01 +00:00
|
|
|
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)
|
2018-12-23 01:31:59 +00:00
|
|
|
target_link_libraries(fullbench libzstd_static)
|
2016-08-18 12:42:28 +00:00
|
|
|
|
2019-04-11 00:47:01 +00:00
|
|
|
add_executable(fuzzer ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/fuzzer.c)
|
2018-12-23 01:31:59 +00:00
|
|
|
target_link_libraries(fuzzer libzstd_static)
|
2016-08-18 12:42:28 +00:00
|
|
|
|
2018-12-23 01:31:59 +00:00
|
|
|
if (UNIX)
|
2019-04-11 00:47:01 +00:00
|
|
|
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)
|
2018-12-23 01:31:59 +00:00
|
|
|
target_link_libraries(paramgrill libzstd_static m) #m is math library
|
2018-12-23 01:31:50 +00:00
|
|
|
endif ()
|