diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2021-06-25 15:41:57 -0400 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-07-06 04:29:55 -0700 |
commit | d922ad3d61abd8e0cfbcbf76a800093e6ba838b3 (patch) | |
tree | c19431bf2a7589d40d42f86794908fe4c4cfe5cc /host/lib/utils | |
parent | c1c05e94b61eb4e6935bfb14ddc338afae9d96d1 (diff) | |
download | uhd-d922ad3d61abd8e0cfbcbf76a800093e6ba838b3.tar.gz uhd-d922ad3d61abd8e0cfbcbf76a800093e6ba838b3.tar.bz2 uhd-d922ad3d61abd8e0cfbcbf76a800093e6ba838b3.zip |
cmake: correctly set and unset any CMAKE_REQUIRED variables
Diffstat (limited to 'host/lib/utils')
-rw-r--r-- | host/lib/utils/CMakeLists.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt index 7e95d8c28..fb796efba 100644 --- a/host/lib/utils/CMakeLists.txt +++ b/host/lib/utils/CMakeLists.txt @@ -43,8 +43,6 @@ CHECK_CXX_SOURCE_COMPILES(" " HAVE_WIN_SETTHREADPRIORITY ) - - if(HAVE_PTHREAD_SETSCHEDPARAM) message(STATUS " Priority scheduling supported through pthread_setschedparam.") list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM) @@ -62,7 +60,6 @@ endif() ######################################################################## set(CMAKE_REQUIRED_LIBRARIES "pthread") - CHECK_CXX_SOURCE_COMPILES(" #include <pthread.h> int main(){ @@ -73,6 +70,7 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_PTHREAD_SETNAME ) +unset(CMAKE_REQUIRED_LIBRARIES) if(CYGWIN) #SCHED_RR non-operational on cygwin @@ -92,6 +90,7 @@ endif() # Setup defines for thread affinitizing ######################################################################## +set(CMAKE_REQUIRED_LIBRARIES "pthread") CHECK_CXX_SOURCE_COMPILES(" #include <pthread.h> int main(){ @@ -102,6 +101,7 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_PTHREAD_SETAFFINITY_NP ) +unset(CMAKE_REQUIRED_LIBRARIES) if(CYGWIN) set(HAVE_PTHREAD_SETAFFINITY_NP False) @@ -115,6 +115,7 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_WIN_SETTHREADAFFINITYMASK ) + if(HAVE_PTHREAD_SETAFFINITY_NP) message(STATUS " Setting thread affinity is supported through pthread_setaffinity_np.") list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETAFFINITY_NP) @@ -127,7 +128,6 @@ else() list(APPEND THREAD_PRIO_DEFS HAVE_THREAD_SETAFFINITY_DUMMY) endif() - set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp PROPERTIES COMPILE_DEFINITIONS "${THREAD_PRIO_DEFS}" @@ -149,7 +149,7 @@ CHECK_CXX_SOURCE_COMPILES(" } " HAVE_DLOPEN ) -set(CMAKE_REQUIRED_LIBRARIES) +unset(CMAKE_REQUIRED_LIBRARIES) CHECK_CXX_SOURCE_COMPILES(" #define WIN32_LEAN_AND_MEAN |