Commit 9ee799d4 authored by Joseph Noir's avatar Joseph Noir

Added macros for RIOT build

parent c97d73e4
...@@ -251,6 +251,11 @@ if (CAF_USE_ASIO) ...@@ -251,6 +251,11 @@ if (CAF_USE_ASIO)
add_definitions(-DCAF_USE_ASIO) add_definitions(-DCAF_USE_ASIO)
endif() endif()
if(CAF_FOR_RIOT)
add_definitions(-D__RIOTBUILD_FLAG)
endif()
################################################################################ ################################################################################
# check for biicode build pipeline # # check for biicode build pipeline #
################################################################################ ################################################################################
...@@ -270,6 +275,7 @@ IF(BIICODE) ...@@ -270,6 +275,7 @@ IF(BIICODE)
RETURN() RETURN()
ENDIF() ENDIF()
################################################################################ ################################################################################
# setup for install target # # setup for install target #
################################################################################ ################################################################################
...@@ -586,6 +592,7 @@ if(NOT CAF_NO_SUMMARY) ...@@ -586,6 +592,7 @@ if(NOT CAF_NO_SUMMARY)
"\nLog level: ${LOG_LEVEL_STR}" "\nLog level: ${LOG_LEVEL_STR}"
"\nWith mem. mgmt.: ${CAF_BUILD_MEM_MANAGEMENT}" "\nWith mem. mgmt.: ${CAF_BUILD_MEM_MANAGEMENT}"
"\nUse Boost ASIO: ${CAF_USE_ASIO}" "\nUse Boost ASIO: ${CAF_USE_ASIO}"
"\nFor RIOT-OS: ${CAF_FOR_RIOT}"
"\n" "\n"
"\nBuild examples: ${CAF_BUILD_EXAMPLES}" "\nBuild examples: ${CAF_BUILD_EXAMPLES}"
"\nBuild unit tests: ${CAF_BUILD_UNIT_TESTS}" "\nBuild unit tests: ${CAF_BUILD_UNIT_TESTS}"
......
...@@ -50,6 +50,10 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -50,6 +50,10 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--no-auto-libc++ do not automatically enable libc++ for Clang --no-auto-libc++ do not automatically enable libc++ for Clang
--warnings-as-errors enables -Werror --warnings-as-errors enables -Werror
--with-asio enable ASIO multiplexer --with-asio enable ASIO multiplexer
--for-riot build CAF for riot
- uses RIOT thread impl
- build without memory management
- static build only
Installation Directories: Installation Directories:
--prefix=PREFIX installation directory [/usr/local] --prefix=PREFIX installation directory [/usr/local]
...@@ -229,6 +233,11 @@ while [ $# -ne 0 ]; do ...@@ -229,6 +233,11 @@ while [ $# -ne 0 ]; do
--no-compiler-check) --no-compiler-check)
append_cache_entry CAF_NO_COMPILER_CHECK BOOL yes append_cache_entry CAF_NO_COMPILER_CHECK BOOL yes
;; ;;
--for-riot)
append_cache_entry CAF_FOR_RIOT BOOL yes
append_cache_entry CAF_NO_MEM_MANAGEMENT BOOL yes
append_cache_entry CAF_BUILD_STATIC_ONLY STRING yes
;;
--no-auto-libc++) --no-auto-libc++)
append_cache_entry CAF_NO_AUTO_LIBCPP BOOL yes append_cache_entry CAF_NO_AUTO_LIBCPP BOOL yes
;; ;;
......
...@@ -236,7 +236,20 @@ class single_reader_queue { ...@@ -236,7 +236,20 @@ class single_reader_queue {
// should be unreachable // should be unreachable
CAF_CRITICAL("invalid result of enqueue()"); CAF_CRITICAL("invalid result of enqueue()");
} }
#ifdef __RIOTBUILD_FLAG
template <class Mutex, class CondVar>
void synchronized_await(Mutex& mtx, CondVar& cv) {
CAF_REQUIRE(!closed());
}
template <class Mutex, class CondVar, class TimePoint>
bool synchronized_await(Mutex& mtx, CondVar& cv, const TimePoint& timeout) {
CAF_REQUIRE(!closed());
}
#else
template <class Mutex, class CondVar> template <class Mutex, class CondVar>
void synchronized_await(Mutex& mtx, CondVar& cv) { void synchronized_await(Mutex& mtx, CondVar& cv) {
CAF_ASSERT(!closed()); CAF_ASSERT(!closed());
...@@ -263,6 +276,7 @@ class single_reader_queue { ...@@ -263,6 +276,7 @@ class single_reader_queue {
} }
return true; return true;
} }
#endif
private: private:
// exposed to "outside" access // exposed to "outside" access
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment