Advertisement
Guest User

build.gradle.kts

a guest
Jul 2nd, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.79 KB | None | 0 0
  1. import org.gradle.internal.os.OperatingSystem
  2.  
  3. plugins {
  4.     `cpp-library`
  5. }
  6.  
  7. library {
  8.     binaries.configureEach {
  9.         compileTask.get()
  10.             .apply {
  11.                 source.from(fileTree("dir" to "src", "include" to "**/*.c"))
  12.                 compilerArgs.addAll("-x", "c", "-std=c11")
  13.             }
  14.     }
  15.     linkage.set(listOf(Linkage.STATIC))
  16.     when (OperatingSystem.current()) {
  17.         OperatingSystem.LINUX -> targetMachines.set(listOf(machines.linux.x86_64))
  18.         OperatingSystem.WINDOWS -> targetMachines.set(listOf(machines.windows.x86_64))
  19.         else -> throw GradleException("Unsupported OS")
  20.     }
  21.  
  22.     source.from(fileTree("dir" to "src", "include" to "**/*.c"))
  23.     publicHeaders.from("include/public")
  24.     privateHeaders.from("include/private")
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement