Search in sources :

Example 1 with GccCommandLineToolConfigurationInternal

use of org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal in project gradle by gradle.

the class GccPlatformToolProvider method createCCompiler.

@Override
protected Compiler<CCompileSpec> createCCompiler() {
    GccCommandLineToolConfigurationInternal cCompilerTool = toolRegistry.getTool(ToolType.C_COMPILER);
    CCompiler cCompiler = new CCompiler(buildOperationExecutor, compilerOutputFileNamingSchemeFactory, commandLineTool(cCompilerTool), context(cCompilerTool), getObjectFileExtension(), useCommandFile, workerLeaseService);
    OutputCleaningCompiler<CCompileSpec> outputCleaningCompiler = new OutputCleaningCompiler<CCompileSpec>(cCompiler, compilerOutputFileNamingSchemeFactory, getObjectFileExtension());
    return versionAwareCompiler(outputCleaningCompiler, ToolType.C_COMPILER);
}
Also used : CCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.CCompileSpec) ObjectiveCCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCCompileSpec) OutputCleaningCompiler(org.gradle.nativeplatform.toolchain.internal.OutputCleaningCompiler) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Example 2 with GccCommandLineToolConfigurationInternal

use of org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal in project gradle by gradle.

the class GccPlatformToolProvider method getGccMetadata.

private SearchResult<GccMetadata> getGccMetadata(ToolType compilerType) {
    GccCommandLineToolConfigurationInternal compiler = toolRegistry.getTool(compilerType);
    if (compiler == null) {
        return new ComponentNotFound<GccMetadata>("Tool " + compilerType.getToolName() + " is not available");
    }
    CommandLineToolSearchResult searchResult = toolSearchPath.locate(compiler.getToolType(), compiler.getExecutable());
    String language = LANGUAGE_FOR_COMPILER.get(compilerType);
    List<String> languageArgs = language == null ? Collections.<String>emptyList() : ImmutableList.of("-x", language);
    return metadataProvider.getCompilerMetaData(toolSearchPath.getPath(), spec -> spec.executable(searchResult.getTool()).args(languageArgs));
}
Also used : ComponentNotFound(org.gradle.platform.base.internal.toolchain.ComponentNotFound) CommandLineToolSearchResult(org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolSearchResult) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Example 3 with GccCommandLineToolConfigurationInternal

use of org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal in project gradle by gradle.

the class GccPlatformToolProvider method createCppPCHCompiler.

@Override
protected Compiler<?> createCppPCHCompiler() {
    GccCommandLineToolConfigurationInternal cppCompilerTool = toolRegistry.getTool(ToolType.CPP_COMPILER);
    CppPCHCompiler cppPCHCompiler = new CppPCHCompiler(buildOperationExecutor, compilerOutputFileNamingSchemeFactory, commandLineTool(cppCompilerTool), context(cppCompilerTool), getPCHFileExtension(), useCommandFile, workerLeaseService);
    OutputCleaningCompiler<CppPCHCompileSpec> outputCleaningCompiler = new OutputCleaningCompiler<CppPCHCompileSpec>(cppPCHCompiler, compilerOutputFileNamingSchemeFactory, getPCHFileExtension());
    return versionAwareCompiler(outputCleaningCompiler, ToolType.CPP_COMPILER);
}
Also used : ObjectiveCppPCHCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCppPCHCompileSpec) CppPCHCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.CppPCHCompileSpec) OutputCleaningCompiler(org.gradle.nativeplatform.toolchain.internal.OutputCleaningCompiler) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Example 4 with GccCommandLineToolConfigurationInternal

use of org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal in project gradle by gradle.

the class AbstractGccCompatibleToolChain method initTools.

protected void initTools(DefaultGccPlatformToolChain platformToolChain, ToolChainAvailability availability) {
    // Attempt to determine whether the compiler is the correct implementation
    for (GccCommandLineToolConfigurationInternal tool : platformToolChain.getCompilers()) {
        CommandLineToolSearchResult compiler = locate(tool);
        if (compiler.isAvailable()) {
            SearchResult<GccMetadata> gccMetadata = getMetaDataProvider().getCompilerMetaData(toolSearchPath.getPath(), spec -> spec.executable(compiler.getTool()).args(platformToolChain.getCompilerProbeArgs()));
            availability.mustBeAvailable(gccMetadata);
            if (!gccMetadata.isAvailable()) {
                return;
            }
            // Assume all the other compilers are ok, if they happen to be installed
            LOGGER.debug("Found {} with version {}", tool.getToolType().getToolName(), gccMetadata);
            initForImplementation(platformToolChain, gccMetadata.getComponent());
            break;
        }
    }
}
Also used : GccMetadata(org.gradle.nativeplatform.toolchain.internal.gcc.metadata.GccMetadata) CommandLineToolSearchResult(org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolSearchResult) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Example 5 with GccCommandLineToolConfigurationInternal

use of org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal in project gradle by gradle.

the class GccPlatformToolProvider method createCppCompiler.

@Override
protected Compiler<CppCompileSpec> createCppCompiler() {
    GccCommandLineToolConfigurationInternal cppCompilerTool = toolRegistry.getTool(ToolType.CPP_COMPILER);
    CppCompiler cppCompiler = new CppCompiler(buildOperationExecutor, compilerOutputFileNamingSchemeFactory, commandLineTool(cppCompilerTool), context(cppCompilerTool), getObjectFileExtension(), useCommandFile, workerLeaseService);
    OutputCleaningCompiler<CppCompileSpec> outputCleaningCompiler = new OutputCleaningCompiler<CppCompileSpec>(cppCompiler, compilerOutputFileNamingSchemeFactory, getObjectFileExtension());
    return versionAwareCompiler(outputCleaningCompiler, ToolType.CPP_COMPILER);
}
Also used : OutputCleaningCompiler(org.gradle.nativeplatform.toolchain.internal.OutputCleaningCompiler) CppCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.CppCompileSpec) ObjectiveCppCompileSpec(org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCppCompileSpec) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Aggregations

GccCommandLineToolConfigurationInternal (org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)10 OutputCleaningCompiler (org.gradle.nativeplatform.toolchain.internal.OutputCleaningCompiler)8 ObjectiveCCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCCompileSpec)2 ObjectiveCPCHCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCPCHCompileSpec)2 ObjectiveCppCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCppCompileSpec)2 ObjectiveCppPCHCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.ObjectiveCppPCHCompileSpec)2 CommandLineToolSearchResult (org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolSearchResult)2 CCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.CCompileSpec)1 CPCHCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.CPCHCompileSpec)1 CppCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.CppCompileSpec)1 CppPCHCompileSpec (org.gradle.nativeplatform.toolchain.internal.compilespec.CppPCHCompileSpec)1 GccMetadata (org.gradle.nativeplatform.toolchain.internal.gcc.metadata.GccMetadata)1 ComponentNotFound (org.gradle.platform.base.internal.toolchain.ComponentNotFound)1