mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
GenEx: Parse comma after colon tokens specially
Otherwise the comma is treated as plain text by ParseContent. $<STREQUAL:,> should be valid and true. $<STREQUAL:,something> should be valid and false. $<STREQUAL:,,> should be non-valid as it is 3 parameters. $<STREQUAL:something,,> should be non-valid as it is 3 parameters. Additionally, this allows reporting the correct error for other expressions. For example $<TARGET_PROPERTY:,> should be invalid because it has an empty target and empty property. It shouldn't attempt to read the property ',' on the 'implicit this' target.
This commit is contained in:
@@ -37,6 +37,8 @@ add_custom_target(check ALL
|
||||
-Dtest_strequal_angle_r=$<STREQUAL:$<ANGLE-R>,$<ANGLE-R>>
|
||||
-Dtest_strequal_comma=$<STREQUAL:$<COMMA>,$<COMMA>>
|
||||
-Dtest_strequal_angle_r_comma=$<STREQUAL:$<ANGLE-R>,$<COMMA>>
|
||||
-Dtest_strequal_both_empty=$<STREQUAL:,>
|
||||
-Dtest_strequal_one_empty=$<STREQUAL:something,>
|
||||
-Dtest_angle_r=$<ANGLE-R>
|
||||
-Dtest_comma=$<COMMA>
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
|
||||
|
||||
@@ -38,5 +38,7 @@ check(test_strequal_no_yes "0")
|
||||
check(test_strequal_angle_r "1")
|
||||
check(test_strequal_comma "1")
|
||||
check(test_strequal_angle_r_comma "0")
|
||||
check(test_strequal_both_empty "1")
|
||||
check(test_strequal_one_empty "0")
|
||||
check(test_angle_r ">")
|
||||
check(test_comma ",")
|
||||
|
||||
Reference in New Issue
Block a user