Do no link binaries with Qt where it's not used

Define components_qt static library with all qt dependent components that also
depends on other components. Link only cs, wizard and launcher with qt
dependent components.
pull/3097/head
elsid 3 years ago
parent 6360bdc859
commit e9b8933b2f
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -14,6 +14,7 @@
Bug #5379: Wandering NPCs falling through cantons
Bug #5453: Magic effect VFX are offset for creatures
Bug #5483: AutoCalc flag is not used to calculate spells cost
Bug #5508: Engine binary links to Qt without using it
Bug #5755: Active grid object paging - disappearing textures
Bug #5788: Texture editing parses the selected indexes wrongly
Bug #5842: GetDisposition adds temporary disposition change from different actors

@ -542,7 +542,6 @@ endif()
# Components
add_subdirectory (components)
target_compile_definitions(components PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
# Apps and tools
if (BUILD_OPENMW)

@ -99,7 +99,7 @@ endif (WIN32)
target_link_libraries(openmw-launcher
${SDL2_LIBRARY_ONLY}
${OPENAL_LIBRARY}
components
components_qt
)
target_link_libraries(openmw-launcher Qt5::Widgets Qt5::Core)

@ -229,7 +229,7 @@ target_link_libraries(openmw-cs
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
components
components_qt
)
if(OSG_STATIC)

@ -99,7 +99,7 @@ openmw_add_executable(openmw-wizard
)
target_link_libraries(openmw-wizard
components
components_qt
)
target_link_libraries(openmw-wizard Qt5::Widgets Qt5::Core)

@ -78,7 +78,7 @@ foreach (u ${ARGN})
file (GLOB ALL "${dir}/${u}.[ch]pp")
foreach (f ${ALL})
list (APPEND files "${f}")
list (APPEND COMPONENT_FILES "${f}")
list (APPEND COMPONENT_QT_FILES "${f}")
endforeach (f)
file (GLOB MOC_H "${dir}/${u}.hpp")
foreach (fi ${MOC_H})

@ -217,7 +217,7 @@ if (USE_QT)
processinvoker
)
add_component_dir (misc
add_component_qt_dir (misc
helpviewer
)
@ -233,7 +233,7 @@ endif ()
include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
add_library(components STATIC ${COMPONENT_FILES})
target_link_libraries(components
# CMake's built-in OSG finder does not use pkgconfig, so we have to
@ -276,7 +276,9 @@ if (WIN32)
endif()
if (USE_QT)
target_link_libraries(components Qt5::Widgets Qt5::Core)
add_library(components_qt STATIC ${COMPONENT_QT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
target_link_libraries(components_qt components Qt5::Widgets Qt5::Core)
target_compile_definitions(components_qt PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
endif()
if (GIT_CHECKOUT)

Loading…
Cancel
Save