Add bt_log macro for logging AI actions
This commit is contained in:
parent
6971b8545a
commit
daa2b9c49a
3 changed files with 14 additions and 0 deletions
|
|
@ -45,6 +45,8 @@ option(PSEMEK_LEGACY_UI "Use legacy UI library" OFF)
|
|||
|
||||
message(STATUS "Using backend ${PSEMEK_BACKEND}")
|
||||
|
||||
option(PSEMEK_BT_LOG "Add logging for behavior tree actions" OFF)
|
||||
|
||||
if(PSEMEK_BACKEND STREQUAL "ANDROID")
|
||||
set(PSEMEK_GL_API gles32)
|
||||
set(PSEMEK_GL_LIBRARIES GLESv3 EGL)
|
||||
|
|
|
|||
|
|
@ -4,3 +4,6 @@ file(GLOB_RECURSE PSEMEK_BT_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "sour
|
|||
psemek_add_library(psemek-bt ${PSEMEK_BT_HEADERS} ${PSEMEK_BT_SOURCES})
|
||||
target_include_directories(psemek-bt PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
target_link_libraries(psemek-bt PUBLIC psemek-util psemek-log)
|
||||
if(PSEMEK_BT_LOG)
|
||||
target_compile_definitions(psemek-bt PUBLIC -DPSEMEK_BT_LOG=1)
|
||||
endif()
|
||||
|
|
|
|||
9
libs/bt/include/psemek/bt/log.hpp
Normal file
9
libs/bt/include/psemek/bt/log.hpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef PSEMEK_BT_LOG
|
||||
#include <psemek/log/log.hpp>
|
||||
#define bt_log ::psemek::log::debug
|
||||
#else
|
||||
#include <psemek/util/null_ostream.hpp>
|
||||
#define bt_log ::psemek::util::null_ostream
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue