/
build.gradle
48 lines (46 loc) · 1.71 KB
/
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
38
39
40
41
42
43
44
45
46
47
plugins {
id 'cpp'
}
model {
buildTypes {
debug
release
}
repositories {
libs(PrebuiltLibraries) {
boost {
headers.srcDir "3rd-party-lib/boost_1_55_0/boost"
}
util {
headers.srcDir "3rd-party-lib/util/src/util/headers"
binaries.withType(StaticLibraryBinary) {
def libName = targetPlatform.operatingSystem.windows ? 'util.lib' : 'libutil.a'
staticLibraryFile = file("3rd-party-lib/util/build/libs/util/static/${buildType.name}/${libName}")
}
binaries.withType(SharedLibraryBinary) {
def os = targetPlatform.operatingSystem
def baseDir = "3rd-party-lib/util/build/libs/util/shared/${buildType.name}"
if (os.windows) {
// Windows uses a .dll file, with a different link file if it exists (not Cygwin or MinGW)
sharedLibraryFile = file("${baseDir}/util.dll")
if (file("${baseDir}/util.lib").exists()) {
sharedLibraryLinkFile = file("${baseDir}/util.lib")
}
} else if (os.macOsX) {
sharedLibraryFile = file("${baseDir}/libutil.dylib")
} else {
sharedLibraryFile = file("${baseDir}/libutil.so")
}
}
}
}
}
components {
main(NativeExecutableSpec) {
sources {
cpp.lib library: 'boost', linkage: 'api'
cpp.lib library: 'util', linkage: 'static'
}
}
}
}