use of org.gradle.nativeplatform.toolchain.internal.UnsupportedPlatformToolProvider in project gradle by gradle.
the class AbstractGccCompatibleToolChain method createPlatformToolProvider.
private PlatformToolProvider createPlatformToolProvider(NativePlatformInternal targetPlatform) {
TargetPlatformConfiguration targetPlatformConfigurationConfiguration = getPlatformConfiguration(targetPlatform);
if (targetPlatformConfigurationConfiguration == null) {
return new UnsupportedPlatformToolProvider(targetPlatform.getOperatingSystem(), String.format("Don't know how to build for %s.", targetPlatform.getDisplayName()));
}
DefaultGccPlatformToolChain configurableToolChain = instantiator.newInstance(DefaultGccPlatformToolChain.class, targetPlatform);
addDefaultTools(configurableToolChain);
configureDefaultTools(configurableToolChain);
targetPlatformConfigurationConfiguration.apply(configurableToolChain);
configureActions.execute(configurableToolChain);
configurableToolChain.compilerProbeArgs(standardLibraryDiscovery.compilerProbeArgs(targetPlatform));
ToolChainAvailability result = new ToolChainAvailability();
initTools(configurableToolChain, result);
if (!result.isAvailable()) {
return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
}
return new GccPlatformToolProvider(buildOperationExecutor, targetPlatform.getOperatingSystem(), toolSearchPath, configurableToolChain, execActionFactory, compilerOutputFileNamingSchemeFactory, configurableToolChain.isCanUseCommandFile(), workerLeaseService, new CompilerMetaDataProviderWithDefaultArgs(configurableToolChain.getCompilerProbeArgs(), metaDataProvider));
}
use of org.gradle.nativeplatform.toolchain.internal.UnsupportedPlatformToolProvider in project gradle by gradle.
the class VisualCppToolChain method select.
@Override
public PlatformToolProvider select(NativePlatformInternal targetPlatform) {
ToolChainAvailability result = new ToolChainAvailability();
result.mustBeAvailable(getAvailability());
if (!result.isAvailable()) {
return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
}
VisualCpp platformVisualCpp = visualCpp == null ? null : visualCpp.forPlatform(targetPlatform);
if (platformVisualCpp == null) {
return new UnsupportedPlatformToolProvider(targetPlatform.getOperatingSystem(), String.format("Don't know how to build for %s.", targetPlatform.getDisplayName()));
}
WindowsSdk platformSdk = windowsSdk.forPlatform(targetPlatform);
SystemLibraries cRuntime = ucrt == null ? new EmptySystemLibraries() : ucrt.getCRuntime(targetPlatform);
DefaultVisualCppPlatformToolChain configurableToolChain = instantiator.newInstance(DefaultVisualCppPlatformToolChain.class, targetPlatform, instantiator);
configureActions.execute(configurableToolChain);
return new VisualCppPlatformToolProvider(buildOperationExecutor, targetPlatform.getOperatingSystem(), configurableToolChain.tools, visualStudio, platformVisualCpp, platformSdk, cRuntime, execActionFactory, compilerOutputFileNamingSchemeFactory, workerLeaseService);
}
use of org.gradle.nativeplatform.toolchain.internal.UnsupportedPlatformToolProvider in project gradle by gradle.
the class VisualCppToolChain method select.
@Override
public PlatformToolProvider select(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine) {
switch(sourceLanguage) {
case CPP:
PlatformToolProvider toolProvider = select(targetMachine);
if (!toolProvider.isAvailable()) {
return toolProvider;
}
ToolSearchResult cppCompiler = toolProvider.locateTool(ToolType.CPP_COMPILER);
if (!cppCompiler.isAvailable()) {
return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cppCompiler);
}
return toolProvider;
case ANY:
return select(targetMachine);
default:
return new UnsupportedPlatformToolProvider(targetMachine.getOperatingSystem(), String.format("Don't know how to compile language %s.", sourceLanguage));
}
}
use of org.gradle.nativeplatform.toolchain.internal.UnsupportedPlatformToolProvider in project gradle by gradle.
the class SwiftcToolChain method createPlatformToolProvider.
private PlatformToolProvider createPlatformToolProvider(NativePlatformInternal targetPlatform) {
DefaultSwiftcPlatformToolChain configurableToolChain = instantiator.newInstance(DefaultSwiftcPlatformToolChain.class, targetPlatform);
addDefaultTools(configurableToolChain);
configureActions.execute(configurableToolChain);
// TODO: this is an approximation as we know swift currently supports only 64-bit runtimes - eventually, we'll want to query for this
if (!isCurrentArchitecture(targetPlatform)) {
return new UnsupportedPlatformToolProvider(targetPlatform.getOperatingSystem(), String.format("Don't know how to build for %s.", targetPlatform.getDisplayName()));
}
CommandLineToolSearchResult compiler = toolSearchPath.locate(ToolType.SWIFT_COMPILER, "swiftc");
ToolChainAvailability result = new ToolChainAvailability();
result.mustBeAvailable(compiler);
if (!result.isAvailable()) {
return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
}
SearchResult<SwiftcMetadata> swiftcMetaData = compilerMetaDataProvider.getCompilerMetaData(toolSearchPath.getPath(), spec -> spec.executable(compiler.getTool()));
result.mustBeAvailable(swiftcMetaData);
if (!result.isAvailable()) {
return new UnavailablePlatformToolProvider(targetPlatform.getOperatingSystem(), result);
}
return new SwiftPlatformToolProvider(buildOperationExecutor, targetPlatform.getOperatingSystem(), toolSearchPath, configurableToolChain, execActionFactory, compilerOutputFileNamingSchemeFactory, workerLeaseService, swiftcMetaData.getComponent());
}
use of org.gradle.nativeplatform.toolchain.internal.UnsupportedPlatformToolProvider in project gradle by gradle.
the class AbstractGccCompatibleToolChain method select.
@Override
public PlatformToolProvider select(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine) {
PlatformToolProvider toolProvider = getProviderForPlatform(targetMachine);
switch(sourceLanguage) {
case CPP:
if (toolProvider instanceof UnsupportedPlatformToolProvider) {
return toolProvider;
}
ToolSearchResult cppCompiler = toolProvider.locateTool(ToolType.CPP_COMPILER);
if (cppCompiler.isAvailable()) {
return toolProvider;
}
// No C++ compiler, complain about it
return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cppCompiler);
case ANY:
if (toolProvider instanceof UnsupportedPlatformToolProvider) {
return toolProvider;
}
ToolSearchResult cCompiler = toolProvider.locateTool(ToolType.C_COMPILER);
if (cCompiler.isAvailable()) {
return toolProvider;
}
ToolSearchResult compiler = toolProvider.locateTool(ToolType.CPP_COMPILER);
if (compiler.isAvailable()) {
return toolProvider;
}
compiler = toolProvider.locateTool(ToolType.OBJECTIVEC_COMPILER);
if (compiler.isAvailable()) {
return toolProvider;
}
compiler = toolProvider.locateTool(ToolType.OBJECTIVECPP_COMPILER);
if (compiler.isAvailable()) {
return toolProvider;
}
// No compilers available, complain about the missing C compiler
return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cCompiler);
default:
return new UnsupportedPlatformToolProvider(targetMachine.getOperatingSystem(), String.format("Don't know how to compile language %s.", sourceLanguage));
}
}
Aggregations