mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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
17 lines
416 B
CMake
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)
|