Ocloc: Add -s to options string for non-spirv input with -g option passed

Automatically add "-s" (source path) option if -g flag is present.
This applies only to non-spirv input.
- Due to conflict, do not automatically append source path when
CMC compiler is used.
- Minor code refactor: use defined compiler options instead of local
strings; wrap filename in quotes (in case of space-separated filename
string).

Related-To: NEO-7285
Signed-off-by: Kacper Nowak kacper.nowak@intel.com
This commit is contained in:
Kacper Nowak
2022-09-09 18:44:06 +00:00
committed by Compute-Runtime-Automation
parent 66f5af0fec
commit 65f7ff2027
6 changed files with 136 additions and 5 deletions

View File

@@ -32,6 +32,11 @@ bool contains(const std::string &options, ConstStringRef optionToFind) {
return contains(options.c_str(), optionToFind);
}
std::string wrapInQuotes(const std::string &stringToWrap) {
std::string quoteEscape{"\""};
return std::string{quoteEscape + stringToWrap + quoteEscape};
}
TokenizedString tokenize(ConstStringRef src, char sperator) {
TokenizedString ret;
const char *it = src.begin();