api / org.gradle.language.nativeplatform.tasks / AbstractNativeSourceCompileTask

AbstractNativeSourceCompileTask

@Incubating abstract class AbstractNativeSourceCompileTask : AbstractNativeCompileTask

Compiles native source files into object files.

Constructors

<init>

AbstractNativeSourceCompileTask()

Functions

getPreCompiledHeader

open fun getPreCompiledHeader(): PreCompiledHeader

Returns the pre-compiled header to be used during compilation

setPreCompiledHeader

open fun setPreCompiledHeader(preCompiledHeader: PreCompiledHeader): Unit

Inherited Functions

compile

open fun compile(inputs: IncrementalTaskInputs): Unit

getCompilerArgs

open fun getCompilerArgs(): ListProperty<String>

Additional arguments to provide to the compiler.

getIncludes

open fun getIncludes(): ConfigurableFileCollection

Returns the header directories to be used for compilation.

getMacros

open fun getMacros(): MutableMap<String, String>

Macros that should be defined for the compiler.

getObjectFileDir

open fun getObjectFileDir(): DirectoryProperty

The directory where object files will be generated.

getSource

open fun getSource(): ConfigurableFileCollection

Returns the source files to be compiled.

getSystemIncludes

open fun getSystemIncludes(): ConfigurableFileCollection

Returns the system include directories to be used for compilation.

getTargetPlatform

open fun getTargetPlatform(): Property<NativePlatform>

The platform being compiled for.

getToolChain

open fun getToolChain(): Property<NativeToolChain>

The tool chain used for compilation.

includes

open fun includes(includeRoots: Any): Unit

Add directories where the compiler should search for header files.

isDebuggable

open fun isDebuggable(): Boolean

Should the compiler generate debuggable code?

isOptimized

open fun isOptimized(): Boolean

Should the compiler generate optimized code?

isPositionIndependentCode

open fun isPositionIndependentCode(): Boolean

Should the compiler generate position independent code?

setDebuggable

open fun setDebuggable(debug: Boolean): Unit

Should the compiler generate debuggable code?

setMacros

open fun setMacros(macros: MutableMap<String, String>): Unit

setOptimized

open fun setOptimized(optimize: Boolean): Unit

Should the compiler generate optimized code?

setPositionIndependentCode

open fun setPositionIndependentCode(positionIndependentCode: Boolean): Unit

source

open fun source(sourceFiles: Any): Unit

Adds a set of source files to be compiled. The provided sourceFiles object is evaluated as per org.gradle.api.Project#files(Object...).

Inheritors

CCompile

open class CCompile : AbstractNativeSourceCompileTask

Compiles C source files into object files.

CppCompile

open class CppCompile : AbstractNativeSourceCompileTask

Compiles C++ source files into object files.

ObjectiveCCompile

open class ObjectiveCCompile : AbstractNativeSourceCompileTask

Compiles Objective-C source files into object files.

ObjectiveCppCompile

open class ObjectiveCppCompile : AbstractNativeSourceCompileTask

Compiles Objective-C++ source files into object files.