diff --git a/CMakeLists.txt b/CMakeLists.txt index bf2e745..dcc3b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) +#cmake_policy(SET CMP0069 NEW) +#include(CheckIPOSupported) +#check_ipo_supported(RESULT supported OUTPUT error) + #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") #set(BUILD_SHARED_LIBS OFF) #set(POSITION_INDEPENDENT_CODE ON) @@ -22,6 +26,14 @@ add_subdirectory(libs/sqlite_orm-1.8.2) find_package(CURL) +if( supported ) + message(STATUS "IPO / LTO enabled") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + set_property(TARGET BLT PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) +else() + message(STATUS "IPO / LTO not supported: <${error}>") +endif() + include_directories(include/) file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") diff --git a/libs/blt b/libs/blt index 9ad6521..9db3f12 160000 --- a/libs/blt +++ b/libs/blt @@ -1 +1 @@ -Subproject commit 9ad652195b0a69f9977d313eff4dd01a7890f1df +Subproject commit 9db3f120489ff27aa560e488d82b5ae0d64019df diff --git a/src/main.cpp b/src/main.cpp index f2fd45b..258dbd7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,6 +78,11 @@ struct db_obj return db.count(); } + inline auto message_count(blt::u64 channel, blt::u64 time) + { + + } + inline auto users() { return db.count(); @@ -593,6 +598,18 @@ int main(int argc, const char** argv) &dpp::message_create_t::send, dpp::utility::log_error()); } + if (blt::string::starts_with(event.msg.content, "!stats")) + { + discord_message message; + for (auto& db : databases) + { + db.second. + } + BLT_TRACE(message.get()); + message.send(event, + &dpp::message_create_t::send, + dpp::utility::log_error()); + } if (blt::string::starts_with(event.msg.content, "!messages")) { for (auto& db : databases)