2017-11-27 20:48:33 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2019-03-27 02:45:20 +00:00
|
|
|
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
|
|
|
if(ENABLE_COVERAGE)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g ")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
|
|
|
endif()
|
|
|
|
endif ()
|
|
|
|
|
2017-11-27 20:48:33 +00:00
|
|
|
# test
|
|
|
|
include_directories(../src)
|
|
|
|
add_executable(test.exe test.c ../src/zip.c)
|
2019-03-27 02:45:20 +00:00
|
|
|
add_executable(test_miniz.exe test_miniz.c)
|
2017-11-27 20:48:33 +00:00
|
|
|
|
|
|
|
add_test(NAME test COMMAND test.exe)
|
2019-03-27 02:45:20 +00:00
|
|
|
add_test(NAME test_miniz COMMAND test_miniz.exe)
|