Class DefaultCCompiler

java.lang.Object
dev.guillermo.gradle.language.c.internal.DefaultCCompiler
All Implemented Interfaces:
CCompiler, org.gradle.api.component.SoftwareComponent, org.gradle.api.Named

public class DefaultCCompiler extends Object implements CCompiler
Default C compiler.
  • Constructor Details

    • DefaultCCompiler

      @Inject public DefaultCCompiler(String name)
      Creates a new instance.
      Parameters:
      name - The compiler name.
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.gradle.api.Named
    • getDialect

      public CDialect getDialect()
      Description copied from interface: CCompiler
      The Dialect of C that should be used for all compilation tasks.
      Specified by:
      getDialect in interface CCompiler
      Returns:
      The Dialect of C that should be used for all compilation tasks.
    • setDialect

      public void setDialect(String dialect)
      Sets the dialect of C that should be used for all compilation tasks.
      Parameters:
      dialect - The dialect of C that should be used for all compilation tasks.
    • getMacros

      public Map<String,String> getMacros()
      Description copied from interface: CCompiler
      Macros that should be defined for all compilation tasks.
      Specified by:
      getMacros in interface CCompiler
      Returns:
      Macros that should be defined for all compilation tasks.
    • failOnWarning

      public boolean failOnWarning()
      Description copied from interface: CCompiler
      Flag to treat warnings as errors in all compilation tasks.
      Specified by:
      failOnWarning in interface CCompiler
      Returns:
      Flag to treat warnings as errors in all compilation tasks.
    • setFailOnWarning

      public void setFailOnWarning(boolean failOnWarning)
      Sets the flag to treat warnings as errors in all compilation tasks.
      Parameters:
      failOnWarning - The flag to treat warnings as errors in all compilation tasks.
    • suppressAllWarnings

      public boolean suppressAllWarnings()
      Description copied from interface: CCompiler
      Flag to suppress all warnings in all compilation tasks.
      Specified by:
      suppressAllWarnings in interface CCompiler
      Returns:
      Flag to suppress all warnings in all compilation tasks.
    • setSuppressAllWarnings

      public void setSuppressAllWarnings(boolean suppressAllWarnings)
      Sets the flag to suppress all warnings in all compilation tasks.
      Parameters:
      suppressAllWarnings - The flag to suppress all warnings in all compilation tasks
    • enableOpenMp

      public boolean enableOpenMp()
      Description copied from interface: CCompiler
      Flag to enable OpenMP support in all compilation tasks.
      Specified by:
      enableOpenMp in interface CCompiler
      Returns:
      Flag to enable OpenMP support in all compilation tasks.
    • setEnableOpenMp

      public void setEnableOpenMp(boolean enableOpenMp)
      Sets the flag to enable OpenMP support in all compilation tasks.
      Parameters:
      enableOpenMp - The flag to enable OpenMP support in all compilation tasks.
    • getGccOptions

      public List<String> getGccOptions()
      Description copied from interface: CCompiler
      User-defined compile options for GCC-compatible toolchains.
      Specified by:
      getGccOptions in interface CCompiler
      Returns:
      User-defined compile options for GCC-compatible toolchains.
    • getVisualCppOptions

      public List<String> getVisualCppOptions()
      Description copied from interface: CCompiler
      User-defined compile options for Visual Studio or Visual C++ toolchains.
      Specified by:
      getVisualCppOptions in interface CCompiler
      Returns:
      User-defined compile options for Visual Studio or Visual C++ toolchains.