summaryrefslogtreecommitdiffstats
path: root/host/lib/utils
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-17 12:35:01 -0800
committerJosh Blum <josh@joshknows.com>2011-02-17 12:35:01 -0800
commit8b0fbfcd12c7f58ad73678f72681c5f75c1d5880 (patch)
tree37d4a4c3e719d8e357a9c123e91874c6ab21a5b0 /host/lib/utils
parente11ced6bab02d8f548f424e0687b81e73769b9a7 (diff)
downloaduhd-8b0fbfcd12c7f58ad73678f72681c5f75c1d5880.tar.gz
uhd-8b0fbfcd12c7f58ad73678f72681c5f75c1d5880.tar.bz2
uhd-8b0fbfcd12c7f58ad73678f72681c5f75c1d5880.zip
uhd: use source properties to set flags and defs not globally, but only for the source
Diffstat (limited to 'host/lib/utils')
-rw-r--r--host/lib/utils/CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt
index 5fa5b4d6d..743528189 100644
--- a/host/lib/utils/CMakeLists.txt
+++ b/host/lib/utils/CMakeLists.txt
@@ -48,14 +48,19 @@ CHECK_CXX_SOURCE_COMPILES("
IF(HAVE_PTHREAD_SETSCHEDPARAM)
MESSAGE(STATUS " Priority scheduling supported through pthread_setschedparam.")
- ADD_DEFINITIONS(-DHAVE_PTHREAD_SETSCHEDPARAM)
+ SET(THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM)
ELSEIF(HAVE_WIN_SETTHREADPRIORITY)
MESSAGE(STATUS " Priority scheduling supported through windows SetThreadPriority.")
- ADD_DEFINITIONS(-DHAVE_WIN_SETTHREADPRIORITY)
+ SET(THREAD_PRIO_DEFS HAVE_WIN_SETTHREADPRIORITY)
ELSE(HAVE_PTHREAD_SETSCHEDPARAM)
MESSAGE(STATUS " Priority scheduling not supported.")
ENDIF(HAVE_PTHREAD_SETSCHEDPARAM)
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/thread_priority.cpp
+ PROPERTIES COMPILE_DEFINITIONS "${THREAD_PRIO_DEFS}"
+)
+
########################################################################
# Setup defines for module loading
########################################################################
@@ -68,15 +73,20 @@ CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H)
IF(HAVE_DLFCN_H)
MESSAGE(STATUS " Module loading supported through dlopen.")
- ADD_DEFINITIONS(-DHAVE_DLFCN_H)
+ SET(LOAD_MODULES_DEFS HAVE_DLFCN_H)
LIBUHD_APPEND_LIBS(${CMAKE_DL_LIBS})
ELSEIF(HAVE_WINDOWS_H)
MESSAGE(STATUS " Module loading supported through LoadLibrary.")
- ADD_DEFINITIONS(-DHAVE_WINDOWS_H)
+ SET(LOAD_MODULES_DEFS HAVE_WINDOWS_H)
ELSE(HAVE_DLFCN_H)
MESSAGE(STATUS " Module loading not supported.")
ENDIF(HAVE_DLFCN_H)
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/load_modules.cpp
+ PROPERTIES COMPILE_DEFINITIONS "${LOAD_MODULES_DEFS}"
+)
+
########################################################################
# Append sources
########################################################################