Skip to content

Commit

Permalink
Detect missing itimerspec on OSX.
Browse files Browse the repository at this point in the history
Set define to compiler accordingly.

This fixes cmake on osx support.
  • Loading branch information
Joshua Boyd authored and Joshua Boyd committed Mar 23, 2016
1 parent b6c4108 commit c82fe88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ if(NOT HAVE_SYS_TIME_H)
endif(MSVC)
endif(NOT HAVE_SYS_TIME_H)

# OSX has sys/time.h, but it still lacks itimerspec
if(HAVE_SYS_TIME_H)
check_struct_member("struct itimerspec" it_value "sys/time.h" HAVE_STRUCT_ITIMERSPEC_IT_VALUE)
if(NOT HAVE_STRUCT_ITIMERSPEC_IT_VALUE)
add_definitions(-DSTRUCT_ITIMERSPEC_DEFINITION_MISSING=1)
set(STRUCT_ITIMERSPEC_DEFINITION_MISSING 1)
endif(NOT HAVE_STRUCT_ITIMERSPEC_IT_VALUE)
endif(HAVE_SYS_TIME_H)

###############################################################################
# Check for integer types
Expand Down

0 comments on commit c82fe88

Please sign in to comment.