ci: declare all oakengine handle types opaque for Qt metatypes; defer gtest discovery on Windows

- Linux GCC rejects QMetaType instantiation over incomplete types
  (static_assert(sizeof(T))); Q_DECLARE_OPAQUE_POINTER every opaque
  OakEngine* handle in the public headers so QList<OakEngineTask*> etc
  compile
- Windows: gtest discovery ran the fresh exe before the DLLs were next
  to it; use DISCOVERY_MODE PRE_TEST on WIN32 and copy the DLLs for
  ctest time
This commit is contained in:
2026-08-02 17:44:51 +08:00
parent d57c812fa6
commit 824e352da1
16 changed files with 46 additions and 8 deletions
+6 -3
View File
@@ -31,11 +31,14 @@ target_include_directories(oakcore_gtest PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../include/olive/core"
)
gtest_discover_tests(oakcore_gtest)
if (WIN32)
# gtest discovery executes the binary at build time; it needs the DLL next to it
# gtest discovery would run the freshly linked exe at build time before the
# DLLs are copied; defer discovery to ctest time on Windows.
gtest_discover_tests(oakcore_gtest DISCOVERY_MODE PRE_TEST)
# The test exe needs the DLL next to it (both for ctest and discovery)
add_custom_command(TARGET oakcore_gtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:olivecore> $<TARGET_FILE_DIR:oakcore_gtest>)
else ()
gtest_discover_tests(oakcore_gtest)
endif ()