From e9e273c012a006b59b68d9053566648cafda3992 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Wed, 1 Oct 2025 11:02:28 -0400 Subject: [PATCH] CMake: PRefix config opt with CONFIG_ --- CMakeLists.txt | 7 +++++++ include/config.h.in | 2 +- smocore/mind.cpp | 4 ++-- todo | 1 - 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed5f79e..7dbd753 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,13 @@ else() set(CONFIG_ENABLE_DEBUG_LOCKS FALSE) endif() +# Set the world thread variable for config.h +if(WORLD_USE_BODY_THREAD) + set(CONFIG_WORLD_USE_BODY_THREAD TRUE) +else() + unset(CONFIG_WORLD_USE_BODY_THREAD) +endif() + # Set the timeout variable for config.h set(CONFIG_DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS ${DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS}) diff --git a/include/config.h.in b/include/config.h.in index 72ed66e..f1c5891 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -13,7 +13,7 @@ #define CONFIG_MRNTT_DEVMGR_REATTACHER_PERIOD_MS @MRNTT_DEVMGR_REATTACHER_PERIOD_MS@ /* World thread configuration */ -#cmakedefine WORLD_USE_BODY_THREAD +#cmakedefine CONFIG_WORLD_USE_BODY_THREAD /* Debug locking configuration */ #cmakedefine CONFIG_ENABLE_DEBUG_LOCKS diff --git a/smocore/mind.cpp b/smocore/mind.cpp index 082225e..e993934 100644 --- a/smocore/mind.cpp +++ b/smocore/mind.cpp @@ -18,7 +18,7 @@ Mind::Mind(void) std::make_shared(ComponentThread::SIMULATOR, *this), std::make_shared(ComponentThread::SUBCONSCIOUS, *this), std::make_shared(ComponentThread::BODY, *this) -#ifndef WORLD_USE_BODY_THREAD +#ifndef CONFIG_WORLD_USE_BODY_THREAD , std::make_shared(ComponentThread::WORLD, *this) #endif }, @@ -27,7 +27,7 @@ Mind::Mind(void) subconscious(*this, componentThreads[2]), body(*this, componentThreads[3]), world(*this, -#ifndef WORLD_USE_BODY_THREAD +#ifndef CONFIG_WORLD_USE_BODY_THREAD componentThreads[4] #else componentThreads[3] diff --git a/todo b/todo index dcc7c2f..266da7d 100644 --- a/todo +++ b/todo @@ -4,4 +4,3 @@ between user errors and program exceptions. * We're now getting to the point where we must implement locking. Go through the driver libs and give them locking. -* Rename WORLD_USE_BODY_THREAD to have CONFIG_ prefix in config.h.