mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC.
If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always added as a compile definition even if the check for it failed.
This commit is contained in:
parent
eccf128665
commit
5d691fe582
1 changed files with 3 additions and 5 deletions
|
@ -168,13 +168,11 @@ if(NOT WIN32 AND NOT DEFINED HAVE_CLOCK_GETTIME)
|
|||
endif()
|
||||
endif()
|
||||
if(HAVE_CLOCK_GETTIME)
|
||||
add_compile_definitions(HAVE_CLOCK_GETTIME)
|
||||
|
||||
# Check if CLOCK_MONOTONIC is available for clock_gettime().
|
||||
check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC)
|
||||
|
||||
add_compile_definitions(
|
||||
HAVE_CLOCK_GETTIME
|
||||
HAVE_CLOCK_MONOTONIC
|
||||
)
|
||||
tuklib_add_definition_if(ALL HAVE_CLOCK_MONOTONIC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in a new issue