Files
CMake/Tests/RunCMake/GeneratorExpression/CMP0200-WARN.cmake
Joerg Bornemann 763aa084b0 CMP0200: Fix crash in configuration selection policy warning
The recently introduced CMP0200 warnings could lead to a crash when
encountering targets with empty configuration values. Avoid calling
substr on an empty `string_view`.

Fixes: #27204
2025-09-17 10:30:12 -04:00

17 lines
416 B
CMake

project(test-CMP0200-WARN C)
set(CMAKE_POLICY_WARNING_CMP0200 ON)
add_library(lib_test1 INTERFACE IMPORTED)
set_target_properties(lib_test1 PROPERTIES
IMPORTED_CONFIGURATIONS "DOG;CAT"
)
add_executable(exe_test1 configtest.c)
target_link_libraries(exe_test1 PRIVATE lib_test1)
add_library(lib_test2 INTERFACE IMPORTED)
add_executable(exe_test2 configtest.c)
target_link_libraries(exe_test2 PRIVATE lib_test2)