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.
Related-To: NEO-7285
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
Kacper Nowak
2022-08-29 13:01:10 +00:00
committed by Compute-Runtime-Automation
parent 710c8cf5ef
commit 301be3c21b
4 changed files with 109 additions and 0 deletions

View File

@@ -30,6 +30,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();

View File

@@ -29,6 +29,7 @@ constexpr ConstStringRef fastRelaxedMath = "-cl-fast-relaxed-math";
constexpr ConstStringRef preserveVec3Type = "-fpreserve-vec3-type";
constexpr ConstStringRef createLibrary = "-create-library";
constexpr ConstStringRef generateDebugInfo = "-g";
constexpr ConstStringRef generateSourcePath = "-s";
constexpr ConstStringRef bindlessMode = "-cl-intel-use-bindless-mode -cl-intel-use-bindless-advanced-mode";
constexpr ConstStringRef uniformWorkgroupSize = "-cl-uniform-work-group-size";
constexpr ConstStringRef forceEmuInt32DivRem = "-cl-intel-force-emu-int32divrem";
@@ -176,6 +177,8 @@ bool contains(const char *options, ConstStringRef optionToFind);
bool contains(const std::string &options, ConstStringRef optionToFind);
std::string wrapInQuotes(const std::string &stringToWrap);
using TokenizedString = StackVec<ConstStringRef, 32>;
TokenizedString tokenize(ConstStringRef src, char sperator = ' ');
} // namespace CompilerOptions