mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
129 lines
5.4 KiB
Groovy
129 lines
5.4 KiB
Groovy
ext {
|
|
nativeName = 'wpiutil'
|
|
devMain = 'edu.wpi.first.wpiutil.DevMain'
|
|
extraSetup = {
|
|
it.sources {
|
|
libuvCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/libuv'
|
|
include '*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/include', 'src/main/native/include/uv-private', 'src/main/native/libuv'
|
|
}
|
|
}
|
|
}
|
|
if (it.targetPlatform.operatingSystem.name != 'windows') {
|
|
it.cppCompiler.define '_LARGEFILE_SOURCE'
|
|
it.cppCompiler.define '_FILE_OFFSET_BITS=64'
|
|
it.cppCompiler.define '_GNU_SOURCE'
|
|
it.sources {
|
|
libuvUnixCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/libuv/unix'
|
|
includes = [
|
|
'async.cpp',
|
|
'core.cpp',
|
|
'dl.cpp',
|
|
'fs.cpp',
|
|
'getaddrinfo.cpp',
|
|
'getnameinfo.cpp',
|
|
'loop-watcher.cpp',
|
|
'loop.cpp',
|
|
'pipe.cpp',
|
|
'poll.cpp',
|
|
'process.cpp',
|
|
'signal.cpp',
|
|
'stream.cpp',
|
|
'tcp.cpp',
|
|
'thread.cpp',
|
|
'timer.cpp',
|
|
'tty.cpp',
|
|
'udp.cpp',
|
|
]
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/include', 'src/main/native/include/uv-private', 'src/main/native/libuv'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (it.targetPlatform.operatingSystem.name == 'windows') {
|
|
if (it in SharedLibraryBinarySpec) {
|
|
it.cppCompiler.define 'BUILDING_UV_SHARED'
|
|
}
|
|
it.sources {
|
|
libuvWindowsCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/libuv/win'
|
|
include '*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/include', 'src/main/native/include/uv-private', 'src/main/native/libuv'
|
|
}
|
|
}
|
|
}
|
|
} else if (it.targetPlatform.operatingSystem.name == 'osx') {
|
|
it.sources {
|
|
libuvMacCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/libuv/unix'
|
|
includes = [
|
|
'bsd-ifaddrs.cpp',
|
|
'darwin.cpp',
|
|
'darwin-proctitle.cpp',
|
|
'fsevents.cpp',
|
|
'kqueue.cpp',
|
|
'proctitle.cpp'
|
|
]
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/include', 'src/main/native/include/uv-private', 'src/main/native/libuv'
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
it.sources {
|
|
libuvLinuxCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/libuv/unix'
|
|
includes = [
|
|
'linux-core.cpp',
|
|
'linux-inotify.cpp',
|
|
'linux-syscalls.cpp',
|
|
'procfs-exepath.cpp',
|
|
'proctitle.cpp',
|
|
'sysinfo-loadavg.cpp',
|
|
'sysinfo-memory.cpp',
|
|
]
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/include', 'src/main/native/include/uv-private', 'src/main/native/libuv'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
|
|
|
|
model {
|
|
// Exports config is a utility to enable exporting all symbols in a C++ library on windows to a DLL.
|
|
// This removes the need for DllExport on a library. However, the gradle C++ builder has a bug
|
|
// where some extra symbols are added that cannot be resolved at link time. This configuration
|
|
// lets you specify specific symbols to exlude from exporting.
|
|
exportsConfigs {
|
|
wpiutil(ExportsConfig) {
|
|
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
|
|
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
|
|
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
|
|
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
|
|
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
|
|
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
|
|
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
|
|
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
|
|
}
|
|
}
|
|
}
|