use of com.google.devtools.build.lib.rules.cpp.CppOptions in project bazel by bazelbuild.
the class LipoDataTransition method apply.
@Override
public BuildOptions apply(BuildOptions options) {
if (options.get(BuildConfiguration.Options.class).isHost) {
return options;
}
// LIPO context to change.
if (!options.contains(CppOptions.class)) {
return options;
}
CppOptions cppOptions = options.get(CppOptions.class);
if (cppOptions.lipoMode == CrosstoolConfig.LipoMode.OFF) {
return options;
}
options = options.clone();
cppOptions = options.get(CppOptions.class);
// Once autoFdoLipoData is on, it stays on (through all future transitions).
if (!cppOptions.autoFdoLipoData && cppOptions.fdoOptimize != null) {
cppOptions.autoFdoLipoData = FdoSupport.isAutoFdo(cppOptions.fdoOptimize);
}
cppOptions.lipoMode = CrosstoolConfig.LipoMode.OFF;
cppOptions.fdoInstrument = null;
cppOptions.fdoOptimize = null;
return options;
}
Aggregations