Search in sources :

Example 1 with CppOptions

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;
}
Also used : CppOptions(com.google.devtools.build.lib.rules.cpp.CppOptions) BuildOptions(com.google.devtools.build.lib.analysis.config.BuildOptions) CppOptions(com.google.devtools.build.lib.rules.cpp.CppOptions)

Aggregations

BuildOptions (com.google.devtools.build.lib.analysis.config.BuildOptions)1 CppOptions (com.google.devtools.build.lib.rules.cpp.CppOptions)1