Fix tests CMakeLists for MIGRATE_MODULE builds

- Top-level CMakeLists.txt: Skip tests subdirectory when MIGRATE_MODULE is set
  (tests require full codebase with cross-module dependencies)
- tests/CMakeLists.txt: Add conditional checks for CodeGen and LtsTimelineClassic targets
  - Filter Grantlee tests BEFORE creating executable (fix order)
  - Exclude CodeGen tests when codegen_base target unavailable
  - Exclude LtsTimelineClassic tests when target unavailable
  - Make LtsTimelineClassic linking conditional with if(TARGET)

This enables clean BUILD_RTI=OFF builds during incremental module migration
with MIGRATE_MODULE flag.
This commit is contained in:
torsten committed 2026-08-24 10:55:53 +02:00
1 parent 92b7f26fc8
commit f6c2ac04f9
2 files changed
+30 -6

No files matched your search

@@ -114,8 +114,12 @@ ENDIF()
ENABLE_TESTING()
INCLUDE(CTest)
# Add migration tests
ADD_SUBDIRECTORY(tests)
# Add migration tests - skip when MIGRATE_MODULE targets specific Lts modules (tests need full codebase)
if(NOT DEFINED MIGRATE_MODULE OR MIGRATE_MODULE STREQUAL "tests")
ADD_SUBDIRECTORY(tests)
else()
message(STATUS "MIGRATE_MODULE=${MIGRATE_MODULE} - skipping tests (need full codebase)")
endif()
CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY)
CONFIGURE_FILE(lts-cc.conf ${CMAKE_BINARY_DIR}/lts-cc.conf.distrib COPYONLY)