From d5ae8c4477540227ae9eee2a91eb053a9d2938df Mon Sep 17 00:00:00 2001 From: Adam Higerd Date: Sun, 8 Feb 2026 13:48:27 -0600 Subject: [PATCH] clean up a few things overlooked before * Move `#include ` into generated .cpp instead of .hpp * Include minimal Sol headers in `script_timer_manager` * Silence more compile-time warnings * Disable unused regex support in cxxopts --- CMakeLists.txt | 10 +++++++++- scripts/generate_db_headers.py | 2 +- src/scripting/script_timer_manager.hpp | 3 ++- tests/common/lightweight_test_harness.hpp | 7 ++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aac2c545..91494228 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ if(ENABLE_SANITIZERS) add_link_options(-fsanitize=address,undefined) endif() +# disable in cxxopts to silence compile warnings +add_compile_options(-DCXXOPTS_NO_REGEX) + # Enable testing support enable_testing() @@ -163,6 +166,11 @@ configure_file( # ============================================================================= # Generate database headers / implementations # ============================================================================= +if(NOT DEFINED MUDITOR_DIR) + set(MUDITOR_DIR ${CMAKE_CURRENT_LIST_DIR}/../muditor) +endif() + + find_package(Python3 REQUIRED COMPONENTS Interpreter) execute_process( COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scripts/generate_db_headers.py --list @@ -180,7 +188,7 @@ list(FILTER DB_HEADERS INCLUDE REGEX "hpp$") add_custom_command( OUTPUT ${DB_SOURCES} ${DB_HEADERS} COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scripts/generate_db_headers.py - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../muditor/packages/db/prisma/schema.prisma + DEPENDS ${MUDITOR_DIR}/packages/db/prisma/schema.prisma ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_db_headers.py ) diff --git a/scripts/generate_db_headers.py b/scripts/generate_db_headers.py index 32843eb9..97d2178c 100755 --- a/scripts/generate_db_headers.py +++ b/scripts/generate_db_headers.py @@ -304,7 +304,6 @@ def generate_enums(self, group_name: str, basename: str) -> tuple[str, str]: '', '#include ', '#include ', - '#include ', '', 'namespace db {', '', @@ -325,6 +324,7 @@ def generate_enums(self, group_name: str, basename: str) -> tuple[str, str]: ' */', '', f'#include "database/generated/{basename}.hpp"', + '#include ', '', 'namespace db {', '', diff --git a/src/scripting/script_timer_manager.hpp b/src/scripting/script_timer_manager.hpp index 76a42b81..2cfdd78f 100644 --- a/src/scripting/script_timer_manager.hpp +++ b/src/scripting/script_timer_manager.hpp @@ -8,7 +8,8 @@ #include #define SOL_ALL_SAFETIES_ON 1 -#include +#include +#include namespace FieryMUD { diff --git a/tests/common/lightweight_test_harness.hpp b/tests/common/lightweight_test_harness.hpp index 67778590..55fa9f37 100644 --- a/tests/common/lightweight_test_harness.hpp +++ b/tests/common/lightweight_test_harness.hpp @@ -3,10 +3,15 @@ #include #include #include -#include #include #include +// Silence spurious warnings in header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#include +#pragma GCC diagnostic pop + #include #include #include