Can I build different binaries for the same source set?


(Ganesh) #1

For Gradle native builds, how can I build the different binaries from the same source set?

For example, I have defined my build.gradle as follows:

model {

	components {
		libasw (NativeExecutableSpec){
			targetPlatform "mySparc"
			sources {
				c {
					source {
						srcDirs "."
						include SRC
						}
					lib library: 'headers', linkage: 'api'
				}
			}
		}
		asw (NativeLibrarySpec){
			targetPlatform "mySparc"
			sources {
				c {
					source {
						srcDirs "."
						include SRC
						}
					lib library: 'headers', linkage: 'api'
				}				
			}
		}
	}
}

I don’t want to repeat the source set multiple times. Is it possible?


(Chris Doré) #2

Have a look at the Native Binary Variants section of the userguide and see if that fits your needs.