Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.gradle.internal.os.OperatingSystem
- plugins {
- `cpp-library`
- }
- library {
- binaries.configureEach {
- compileTask.get()
- .apply {
- source.from(fileTree("dir" to "src", "include" to "**/*.c"))
- compilerArgs.addAll("-x", "c", "-std=c11")
- }
- }
- linkage.set(listOf(Linkage.STATIC))
- when (OperatingSystem.current()) {
- OperatingSystem.LINUX -> targetMachines.set(listOf(machines.linux.x86_64))
- OperatingSystem.WINDOWS -> targetMachines.set(listOf(machines.windows.x86_64))
- else -> throw GradleException("Unsupported OS")
- }
- source.from(fileTree("dir" to "src", "include" to "**/*.c"))
- publicHeaders.from("include/public")
- privateHeaders.from("include/private")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement