Files
CMake/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake
Ben Boeckel 050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
Since it can be set in the environment when running the test suite,
guard tests which are sensitive to intermediate directory strategy
changes with explicit settings.
2025-07-29 08:06:30 -04:00

29 lines
672 B
CMake

set(CMAKE_INTERMEDIATE_DIR_STRATEGY FULL CACHE STRING "" FORCE)
enable_language(C)
enable_testing()
if(CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "cross compiling")
endif()
cmake_policy(SET CMP0158 OLD)
add_test(NAME DoesNotUseEmulator
COMMAND ${CMAKE_COMMAND} -E echo "Hi")
add_executable(exe main.c)
add_test(NAME UsesEmulator
COMMAND exe)
add_test(NAME DoesNotUseEmulatorWithGenex
COMMAND $<TARGET_FILE:exe>)
add_subdirectory(AddTest)
add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex
COMMAND subdir_exe_no_genex)
add_test(NAME DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex
COMMAND $<TARGET_FILE:subdir_exe_with_genex>)