1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[llvm-lit] Improve the error message when make_paths_relative() fails

Previously, if make_paths_relative() failed due to some reason, it would
happily keep going and set the ${out_pathlist} to the standard output
of the command, which would be the empty string if the command failed.

This can lead to issues that are difficult to diagnose, since the calling
code will usually try to keep going with a variable that was set to the
empty string.

Differential Revision: https://reviews.llvm.org/D89985
This commit is contained in:
Louis Dionne 2020-10-22 16:34:19 -04:00
parent 140ee27fee
commit a6efd2facf

View File

@ -1500,7 +1500,12 @@ if len(sys.argv) < 3: sys.exit(0)\n
sys.stdout.write(';'.join(relpath(p) for p in sys.argv[2].split(';')))"
${basedir}
${pathlist_escaped}
OUTPUT_VARIABLE pathlist_relative)
OUTPUT_VARIABLE pathlist_relative
ERROR_VARIABLE error
RESULT_VARIABLE result)
if (NOT result EQUAL 0)
message(FATAL_ERROR "make_paths_relative() failed due to error '${result}', with stderr\n${error}")
endif()
set(${out_pathlist} "${pathlist_relative}" PARENT_SCOPE)
endfunction()