From 24d07da29c6c2bfb1ec4e645bfc96690b8bd61cf Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 15 Jan 2026 18:35:12 +0000 Subject: [PATCH] Rejig components defines OPENMW_DOC_BASEURL is only used in a CMake-configured file, so it only needs to be a CMake variable, which it already is. There's no benefit to making it visible to every TU in components. MYGUI_DONT_USE_OBSOLETE should be visible in everything that transitively includes MyGUI just in case. This should really be set up by MyGUI's CMake config or embedded in a generated MyGUI header rather than being our responsibility, but while we're forced to deal with it, it's closer to right to make it a PUBLIC define on components rather than a directory-scoped define in the components directory. --- apps/openmw/CMakeLists.txt | 2 -- components/CMakeLists.txt | 7 ++++--- components/version/version.cpp.in | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 22956bf00f..ece2cb3bfb 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -214,8 +214,6 @@ if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC) ) endif() -add_definitions(-DMYGUI_DONT_USE_OBSOLETE=ON) - if (ANDROID) target_link_libraries(openmw-lib EGL android log z) endif (ANDROID) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 76d4722614..3958634e3f 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -313,7 +313,6 @@ add_component_dir (debug debugging debuglog gldebug debugdraw writeflags ) -add_definitions(-DMYGUI_DONT_USE_OBSOLETE=ON) IF(NOT WIN32 AND NOT APPLE) add_definitions(-DGLOBAL_DATA_PATH="${GLOBAL_DATA_PATH}") add_definitions(-DGLOBAL_CONFIG_PATH="${GLOBAL_CONFIG_PATH}") @@ -660,8 +659,10 @@ endif() # Make the variable accessible for other subdirectories set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE) -target_compile_definitions(components PUBLIC BT_USE_DOUBLE_PRECISION) -target_compile_definitions(components PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}") +target_compile_definitions(components PUBLIC + BT_USE_DOUBLE_PRECISION + MYGUI_DONT_USE_OBSOLETE=ON +) if(OSG_STATIC) unset(_osg_plugins_static_files) diff --git a/components/version/version.cpp.in b/components/version/version.cpp.in index 12192785b7..35dcb533f5 100644 --- a/components/version/version.cpp.in +++ b/components/version/version.cpp.in @@ -55,8 +55,8 @@ namespace Version std::string_view getDocumentationUrl() { if constexpr (std::string_view("@OPENMW_VERSION_COMMITHASH@") == "@OPENMW_VERSION_TAGHASH@") - return OPENMW_DOC_BASEURL "openmw-@OPENMW_VERSION_MAJOR@.@OPENMW_VERSION_MINOR@.@OPENMW_VERSION_RELEASE@/"; + return "@OPENMW_DOC_BASEURL@openmw-@OPENMW_VERSION_MAJOR@.@OPENMW_VERSION_MINOR@.@OPENMW_VERSION_RELEASE@/"; else - return OPENMW_DOC_BASEURL "latest/"; + return "@OPENMW_DOC_BASEURL@latest/"; } }