Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
endif (WIN32)
find_library(RT_LIBRARY rt)
endif (WIN32)
find_library(RT_LIBRARY rt)
-if (RT_LIBRARY)
- set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY})
-endif (RT_LIBRARY)
-
-set(CMOCKA_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "cmocka required system libraries")
+if (RT_LIBRARY AND NOT LINUX)
+ set(CMOCKA_REQUIRED_LIBRARIES ${RT_LIBRARY} CACHE INTERNAL "cmocka required system libraries")
+endif ()
# OPTIONS
check_c_source_compiles("
# OPTIONS
check_c_source_compiles("
endif(WIN32)
if (HAVE_TIME_H AND HAVE_STRUCT_TIMESPEC AND HAVE_CLOCK_GETTIME)
endif(WIN32)
if (HAVE_TIME_H AND HAVE_STRUCT_TIMESPEC AND HAVE_CLOCK_GETTIME)
- set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY})
+ if (RT_LIBRARY)
+ set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY})
+ endif()
- message(STATUS "CMAKE_REQUIRED_INCLUDES=${CMAKE_REQUIRED_INCLUDES} CMAKE_REQUIRED_LIBRARIES=${CMAKE_REQUIRED_LIBRARIES}")
check_c_source_compiles("
#include <time.h>
check_c_source_compiles("
#include <time.h>
return 0;
}" HAVE_CLOCK_GETTIME_REALTIME)
return 0;
}" HAVE_CLOCK_GETTIME_REALTIME)
+
+ # reset cmake requirements
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_REQUIRED_LIBRARIES)