Prepend -s option when -cmc is not used

Related-To: NEO-5582

- "-s filename" is added to build options
based on filename returned from debugger
- when "-cmc" is passed as first option, do not
modify user options.

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-03-01 16:09:19 +01:00
committed by Compute-Runtime-Automation
parent 042e971a93
commit 4191dfdb43
5 changed files with 41 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -99,10 +99,7 @@ cl_int Program::build(
}
appendKernelDebugOptions(*clDevice, internalOptions);
notifyDebuggerWithSourceCode(*clDevice, filename);
if (!filename.empty()) {
// Add "-s" flag first so it will be ignored by clang in case the options already have this flag set.
options = std::string("-s ") + filename + " " + options;
}
prependFilePathToOptions(filename);
phaseReached[clDevice->getRootDeviceIndex()] = BuildPhase::SourceCodeNotification;
}