640420597f1ee4bab1b6c750739ae4a66ce035af
[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 add_compile_definitions(
9     $<$<BOOL:${HAVE_CLOCK_GETTIME}>:HAVE_CLOCK_GETTIME>
10     $<$<BOOL:${APPLE}>:FLAC__SYS_DARWIN>)
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>)