mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-29 02:20:17 -06:00
Tests: Quote possibly empty string(REPLACE) argument
The ${unity_source_line} variable should not normally be empty,
but it has been observed that it sometimes is due to other factors.
Rather than causing string(REPLACE) to fail due to the wrong
number of arguments, quote the variable so that the
UnityBuildPre2017 test case fails with a more appropriate
error in the block just after the usage fixed by this change.
This commit is contained in:
@@ -27,7 +27,7 @@ foreach(line IN LISTS tgt_projects_strings)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
|
||||
string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
|
||||
string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_c.c" unity_source_file_position)
|
||||
if (unity_source_file_position EQUAL "-1")
|
||||
set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
|
||||
|
||||
Reference in New Issue
Block a user