diff --git a/.gitmodules b/.gitmodules index 0aaa6a6..58c2fc5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "fsfw"] path = fsfw url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw.git +[submodule "spdlog"] + path = spdlog + url = https://github.com/gabime/spdlog.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b2d4b2..d4d8f99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,7 @@ set(MISSION_PATH mission) set(COMMON_PATH common) set(TEST_PATH test) set(LWIP_PATH lwip) +set(SPDLOG_PATH spdlog) set(LIB_FSFW_HAL_PATH fsfw_hal) # Analyse different OS and architecture/target options, determine BSP_PATH, @@ -117,11 +118,15 @@ add_subdirectory(${LIB_FSFW_HAL_PATH}) # Post-Sources preparation ################################################################################ +# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} sbdlog) +add_subdirectory(spdlog) + # Add libraries for all sources. target_link_libraries(${TARGET_NAME} PRIVATE ${LIB_FSFW_NAME} ${LIB_OS_NAME} ${LIB_FSFW_HAL_NAME} + spdlog ) # Add include paths for all sources. diff --git a/spdlog b/spdlog new file mode 160000 index 0000000..87133ef --- /dev/null +++ b/spdlog @@ -0,0 +1 @@ +Subproject commit 87133ef6b7e36913abfaaddf89af309f5f142650 diff --git a/test/TestTask.cpp b/test/TestTask.cpp index b1353d5..7ad282c 100644 --- a/test/TestTask.cpp +++ b/test/TestTask.cpp @@ -3,6 +3,12 @@ #include #include +#define TEST_SPDLOG 1 + +#if TEST_SPDLOG == 1 +#include "spdlog/spdlog.h" +#endif + bool TestTask::oneShotAction = true; MutexIF* TestTask::testLock = nullptr; @@ -45,6 +51,9 @@ ReturnValue_t TestTask::performOperation(uint8_t operationCode) { ReturnValue_t TestTask::performOneShotAction() { /* Everything here will only be performed once. */ +#if TEST_SPDLOG == 1 + spdlog::info("Welcome to spdlog!"); +#endif return HasReturnvaluesIF::RETURN_OK; }