Use CMakePushCheckState
Change-Id: I58d779674363a7f7db4a7ea4ca4a9f4a9e271798 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
1f96506748
commit
cc8e2c4572
@ -1,8 +1,9 @@
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
|
||||
find_library(LIBRT rt)
|
||||
|
||||
set(_libraries "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
cmake_push_check_state()
|
||||
if(LIBRT_FOUND)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBRT}")
|
||||
endif()
|
||||
@ -15,8 +16,7 @@ int main(int argc, char *argv[]) {
|
||||
timespec ts; clock_gettime(CLOCK_REALTIME, &ts);
|
||||
}" HAVE_GETTIME)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${_libraries}")
|
||||
unset(_libraries)
|
||||
cmake_pop_check_state()
|
||||
|
||||
add_library(WrapRt INTERFACE)
|
||||
if (LIBRT_FOUND)
|
||||
|
Loading…
x
Reference in New Issue
Block a user