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

@@ -616,6 +616,12 @@ int OfflineCompiler::initialize(size_t numArgs, const std::vector<std::string> &
if (hwInfo.platform.eRenderCoreFamily >= IGFX_GEN9_CORE) {
internalOptions = CompilerOptions::concatenate(internalOptions, CompilerOptions::debugKernelEnable);
}
if (false == inputFileSpirV && false == CompilerOptions::contains(options, CompilerOptions::generateSourcePath) && false == CompilerOptions::contains(options, CompilerOptions::useCMCompiler)) {
auto sourcePathStringOption = CompilerOptions::generateSourcePath.str();
sourcePathStringOption.append(" ");
sourcePathStringOption.append(CompilerOptions::wrapInQuotes(inputFile));
options = CompilerOptions::concatenate(options, sourcePathStringOption);
}
}
if (deviceName.empty()) {