From 03a2bfab57c14bf85581d502b787e54f645dec38 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 24 Apr 2021 16:22:04 +0100 Subject: [PATCH] Added debug build warnings --- CMakeLists.txt | 6 +++++- README.md | 2 +- src/Application.cpp | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ccf2c6e..cf3f7415 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.12) project(Bloom LANGUAGES CXX VERSION 0.0.2) set(CMAKE_VERBOSE_MAKEFILE off) @@ -158,6 +158,10 @@ target_link_options( PUBLIC [=[-Wl,--disable-new-dtags]=] #,--verbose ) +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + add_compile_definitions(BLOOM_DEBUG_BUILD) +endif() + if (${ENABLE_SANITIZERS}) message(WARNING "Sanitizers have been enabled") diff --git a/README.md b/README.md index 533bbb6e..732e4802 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The components described above interact with each other using an event-based mec To compile Bloom, the following dependencies must be resolved. The accompanying installation commands require support for apt-get. -#### CMake version 3.10 or later: +#### CMake version 3.12 or later: This can be installed via `sudo apt-get install cmake`, provided the appropriate version is available in your OS package repositories. Otherwise, you'll need to download CMake from the official website. diff --git a/src/Application.cpp b/src/Application.cpp index 1459a810..b985395a 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -37,6 +37,10 @@ int Application::run(const std::vector& arguments) { } } +#ifdef BLOOM_DEBUG_BUILD + Logger::warning("This is a debug build - some functions may not work as expected."); +#endif + this->startup(); if (this->insightConfig.insightEnabled) { @@ -162,6 +166,11 @@ int Application::presentVersionText() { Logger::silence(); std::cout << "Bloom v" << Application::VERSION_STR << "\n"; + +#ifdef BLOOM_DEBUG_BUILD + std::cout << "DEBUG BUILD - Compilation timestamp: " << __DATE__ << " " << __TIME__ << "\n"; +#endif + std::cout << "https://bloom.oscillate.io/" << "\n"; std::cout << "Nav Mohammed" << std::endl; return EXIT_SUCCESS;