Permalink
Switch branches/tags
Find file Copy path
3ffb579 Dec 18, 2017
3 contributors

Users who have contributed to this file

@bigdaz @adammurdoch @Sunhick
47 lines (44 sloc) 1.71 KB
apply plugin: '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'
}
}
}
}