CMake minimum required lowered to 3.1
[flac.git] / microbench / CMakeLists.txt
1 if(MSVC)
2     return()
3 endif()
4
5 set(CMAKE_REQUIRED_LIBRARIES rt)
6 check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
7
8 if(APPLE)
9     add_definitions(-DFLAC__SYS_DARWIN)
10 endif()
11
12 add_executable(benchmark_residual benchmark_residual.c util.c)
13 target_include_directories(benchmark_residual PRIVATE
14     "$<TARGET_PROPERTY:FLAC-static,SOURCE_DIR>/include")
15 target_link_libraries(benchmark_residual
16     FLAC-static
17     $<$<BOOL:${HAVE_CLOCK_GETTIME}>:rt>)