Search in sources :

Example 1 with UnavailablePlatformToolProvider

use of org.gradle.nativeplatform.toolchain.internal.UnavailablePlatformToolProvider in project gradle by gradle.

the class AbstractGccCompatibleToolChain method createPlatformToolProvider.

private PlatformToolProvider createPlatformToolProvider(NativePlatformInternal targetPlatform) {
    TargetPlatformConfiguration targetPlatformConfigurationConfiguration = getPlatformConfiguration(targetPlatform);
    ToolChainAvailability result = new ToolChainAvailability();
    if (targetPlatformConfigurationConfiguration == null) {
        result.unavailable(String.format("Don't know how to build for platform '%s'.", targetPlatform.getName()));
        return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
    }
    DefaultGccPlatformToolChain configurableToolChain = instantiator.newInstance(DefaultGccPlatformToolChain.class, targetPlatform);
    addDefaultTools(configurableToolChain);
    configureDefaultTools(configurableToolChain);
    targetPlatformConfigurationConfiguration.apply(configurableToolChain);
    configureActions.execute(configurableToolChain);
    initTools(configurableToolChain, result);
    if (!result.isAvailable()) {
        return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
    }
    return new GccPlatformToolProvider(buildOperationProcessor, targetPlatform.getOperatingSystem(), toolSearchPath, configurableToolChain, execActionFactory, compilerOutputFileNamingSchemeFactory, configurableToolChain.isCanUseCommandFile());
}
Also used : UnavailablePlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.UnavailablePlatformToolProvider) ToolChainAvailability(org.gradle.platform.base.internal.toolchain.ToolChainAvailability)

Example 2 with UnavailablePlatformToolProvider

use of org.gradle.nativeplatform.toolchain.internal.UnavailablePlatformToolProvider in project gradle by gradle.

the class VisualCppToolChain method select.

@Override
public PlatformToolProvider select(NativePlatformInternal targetPlatform) {
    ToolChainAvailability result = new ToolChainAvailability();
    result.mustBeAvailable(getAvailability());
    if (visualCpp != null && !visualCpp.isSupportedPlatform(targetPlatform)) {
        result.unavailable(String.format("Don't know how to build for platform '%s'.", targetPlatform.getName()));
    }
    if (!result.isAvailable()) {
        return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
    }
    DefaultVisualCppPlatformToolChain configurableToolChain = instantiator.newInstance(DefaultVisualCppPlatformToolChain.class, targetPlatform, instantiator);
    configureActions.execute(configurableToolChain);
    return new VisualCppPlatformToolProvider(buildOperationProcessor, targetPlatform.getOperatingSystem(), configurableToolChain.tools, visualCpp, windowsSdk, ucrt, targetPlatform, execActionFactory, compilerOutputFileNamingSchemeFactory);
}
Also used : UnavailablePlatformToolProvider(org.gradle.nativeplatform.toolchain.internal.UnavailablePlatformToolProvider) ToolChainAvailability(org.gradle.platform.base.internal.toolchain.ToolChainAvailability)

Aggregations

UnavailablePlatformToolProvider (org.gradle.nativeplatform.toolchain.internal.UnavailablePlatformToolProvider)2 ToolChainAvailability (org.gradle.platform.base.internal.toolchain.ToolChainAvailability)2