Export C functions from JNI statically linked library (#1425)

The JNI libraries are useful from other tools, so they should contain the C functions.
This commit is contained in:
Thad House
2018-11-12 19:38:35 -08:00
committed by Peter Johnson
parent f54c0f70f6
commit ecd376be4c
5 changed files with 61 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ class SingleNativeBuild implements Plugin<Project> {
components.each { component ->
if (component.name == "${nativeName}Base") {
base = (NativeLibrarySpec) component
} else if (component.name == "${nativeName}") {
} else if (component.name == "${nativeName}" || component.name == "${nativeName}JNI") {
subs << component
}
}

View File

@@ -100,6 +100,26 @@ model {
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure']
}
cscoreJNI(ExportsConfig) {
x86SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('CS_')) {
retList << symbol
}
}
return retList
}
x64SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('CS_')) {
retList << symbol
}
}
return retList
}
}
}
components {
examplesMap.each { key, value ->

View File

@@ -179,5 +179,25 @@ model {
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure']
}
halJNI(ExportsConfig) {
x86SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('HAL_') || symbol.startsWith('HALSIM_')) {
retList << symbol
}
}
return retList
}
x64SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('HAL_') || symbol.startsWith('HALSIM_')) {
retList << symbol
}
}
return retList
}
}
}
}

View File

@@ -21,6 +21,26 @@ model {
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure']
}
ntcoreJNI(ExportsConfig) {
x86SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('NT_')) {
retList << symbol
}
}
return retList
}
x64SymbolFilter = { symbols ->
def retList = []
symbols.each { symbol ->
if (symbol.startsWith('NT_')) {
retList << symbol
}
}
return retList
}
}
}
}

View File

@@ -162,7 +162,6 @@ model {
it.buildable = false
return
}
lib library: "${nativeName}", linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
if (project.hasProperty('jniSplitSetup')) {
jniSplitSetup(it)