This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][CMake] Fix an issue when there is space in the argument LIBOMPTARGET_LIT_ARGS
ClosedPublic

Authored by tianshilei1992 on Jul 18 2021, 2:03 PM.

Details

Summary

D106236 added a new CMake argument for libomptarget test, but when user's
input contains white spaces, CMake will add escape char to the final lit command,
which leads to an error. This patch converts the user's input LIBOMPTARGET_LIT_ARGS
into a local array, and then passes the array to the function.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Jul 18 2021, 2:03 PM
tianshilei1992 requested review of this revision.Jul 18 2021, 2:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2021, 2:03 PM
openmp/libomptarget/test/CMakeLists.txt
17

I think everything is global in cmake, so this will overwrite any other value of LIT_ARGS. If so, this probably needs to be spelled LIBOMPTARGET_LIT_ARGS_SANITIZED or similar

tianshilei1992 marked an inline comment as done.Jul 18 2021, 2:39 PM
JonChesterfield accepted this revision.Jul 18 2021, 3:29 PM
This revision is now accepted and ready to land.Jul 18 2021, 3:29 PM