1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-23 19:30:54 +00:00

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.
This commit is contained in:
AnyOldName3 2026-01-15 18:35:12 +00:00
parent e68d4317c4
commit 24d07da29c
3 changed files with 6 additions and 7 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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/";
}
}