api / org.gradle.language.nativeplatform / DependentSourceSet

DependentSourceSet

@Incubating interface DependentSourceSet : LanguageSourceSet

A source set that depends on one or more org.gradle.nativeplatform.NativeDependencySets to be built.

Functions

getLibs

abstract fun getLibs(): MutableCollection<*>

The libraries that this source set requires.

getPreCompiledHeader

abstract fun getPreCompiledHeader(): String

Returns the pre-compiled header configured for this source set.

lib

abstract fun lib(library: Any): Unit

Adds a library that this source set requires. This method accepts the following types:

  • A org.gradle.nativeplatform.NativeLibrarySpec
  • A org.gradle.nativeplatform.NativeDependencySet
  • A LanguageSourceSet
  • A java.util.Map containing the library selector.
The Map notation supports the following String attributes:
  • project: the path to the project containing the library (optional, defaults to current project)
  • library: the name of the library (required)
  • linkage: the library linkage required ['shared'/'static'] (optional, defaults to 'shared')

setPreCompiledHeader

abstract fun setPreCompiledHeader(header: String): Unit

Sets the pre-compiled header to be used when compiling sources in this source set.

Inherited Functions

generatedBy

abstract fun generatedBy(generatorTask: Task): Unit

getParentName

abstract fun getParentName(): String

getSource

abstract fun getSource(): SourceDirectorySet

The source files.

Inheritors

CSourceSet

interface CSourceSet : HeaderExportingSourceSet, LanguageSourceSet, DependentSourceSet

A set of C source files.

A C source set contains a set of source files, together with an optional set of exported header files.

 apply plugin: "c" model { components { main(NativeLibrarySpec) { sources { c { source { srcDirs "src/main/cpp", "src/shared/c++" include "**/*.c" } exportedHeaders { srcDirs "src/main/include" } } } } } } 

CppSourceSet

interface CppSourceSet : HeaderExportingSourceSet, LanguageSourceSet, DependentSourceSet

A set of C++ source files.

A C++ source set contains a set of source files, together with an optional set of exported header files.

 apply plugin: "cpp" model { components { main(NativeLibrarySpec) { sources { cpp { source { srcDirs "src/main/cpp", "src/shared/c++" include "**/*.cpp" } exportedHeaders { srcDirs "src/main/include", "src/shared/include" } } } } } } 

ObjectiveCSourceSet

interface ObjectiveCSourceSet : HeaderExportingSourceSet, LanguageSourceSet, DependentSourceSet

A set of Objective-C source files.

An ObjectiveC source set contains a set of source files, together with an optional set of exported header files.

 apply plugin: "objective-c" model { components { main(NativeLibrarySpec) { sources { objc { source { srcDirs "src/main/objectiveC", "src/shared/objectiveC" include "**/*.m" } exportedHeaders { srcDirs "src/main/include" } } } } } } 

ObjectiveCppSourceSet

interface ObjectiveCppSourceSet : HeaderExportingSourceSet, LanguageSourceSet, DependentSourceSet

A set of Objective-C++ source files.

An Objective-C++ source set contains a set of source files, together with an optional set of exported header files.

 apply plugin: "objective-cpp" model { components { main(NativeLibrarySpec) { sources { objcpp { source { srcDirs "src/main/objectiveCpp", "src/shared/objectiveCpp" include "**/*.mm" } exportedHeaders { srcDirs "src/main/include" } } } } } }