use of org.gradle.platform.base.internal.toolchain.ToolSearchResult 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.platform.base.internal.toolchain.ToolSearchResult 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