diff options
Diffstat (limited to 'cmake/Modules/GrMiscUtils.cmake')
-rw-r--r-- | cmake/Modules/GrMiscUtils.cmake | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake index 69ff1f5..3d9a5f5 100644 --- a/cmake/Modules/GrMiscUtils.cmake +++ b/cmake/Modules/GrMiscUtils.cmake @@ -268,15 +268,15 @@ function(GRCC) set(filenames ${ARGV}) file(MAKE_DIRECTORY ${directory}) - SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/src/python/grcc) + SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/python/grcc) - # GRCC uses some stuff in grc and gnuradio-core, so we force + # GRCC uses some stuff in grc and gnuradio-runtime, so we force # the known paths here list(APPEND PYTHONPATHS ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/gnuradio-core/src/python - ${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/swig - ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_SOURCE_DIR}/gnuradio-runtime/python + ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/swig + ${CMAKE_BINARY_DIR}/gnuradio-runtime/lib/swig ) if(WIN32) @@ -317,3 +317,31 @@ function(GRCC) set(PYFILES ${pyfiles} PARENT_SCOPE) endfunction(GRCC) + +######################################################################## +# Check if HAVE_PTHREAD_SETSCHEDPARAM and HAVE_SCHED_SETSCHEDULER +# should be defined +######################################################################## +macro(GR_CHECK_LINUX_SCHED_AVAIL) +set(CMAKE_REQUIRED_LIBRARIES -lpthread) + CHECK_CXX_SOURCE_COMPILES(" + #include <pthread.h> + int main(){ + pthread_t pthread; + pthread_setschedparam(pthread, 0, 0); + return 0; + } " HAVE_PTHREAD_SETSCHEDPARAM + ) + GR_ADD_COND_DEF(HAVE_PTHREAD_SETSCHEDPARAM) + + CHECK_CXX_SOURCE_COMPILES(" + #include <sched.h> + int main(){ + pid_t pid; + sched_setscheduler(pid, 0, 0); + return 0; + } " HAVE_SCHED_SETSCHEDULER + ) + GR_ADD_COND_DEF(HAVE_SCHED_SETSCHEDULER) +endmacro(GR_CHECK_LINUX_SCHED_AVAIL) + |