forked from lacasseio/windowsnative
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
37 lines (28 loc) · 956 Bytes
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
plugins {
id 'cpp-library'
}
library {
targetMachines = [
machines.linux.x86_64,
machines.windows.x86, machines.windows.x86_64,
machines.macOS.x86_64
]
linkage = [Linkage.SHARED]
binaries.configureEach { CppBinary binary ->
def compileTask = binary.compileTask.get()
compileTask.source.from fileTree(dir: "src/main/cpp", include: "**/*.cpp")
def toolChain = binary.toolChain
if (toolChain instanceof VisualCpp) {
compileTask.compilerArgs.addAll(["/TP"])
} else if (compileTask.targetPlatform.get().operatingSystem.isMacOsX()) {
compileTask.compilerArgs.add('-std=gnu++17')
}
def linkTask = binary.linkTask.get()
linkTask.linkerArgs.addAll(linkTask.targetPlatform.map {
if (it.operatingSystem.isWindows()) {
return ['user32.lib']
}
return []
})
}
}