Skip to content

Commit

Permalink
Use debug libraries for opencv and ni libraries (#253)
Browse files Browse the repository at this point in the history
* Use debug libraries for opencv and ni libraries

opencv is becoming a requirement in beta 4, and ni libraries were a good idea. All debug things should be linked to debug

* Fix rio cpp debug, and bad C++ link
  • Loading branch information
ThadHouse authored and JaciBrunning committed Dec 15, 2018
1 parent a086d0f commit 5603d1f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
4 changes: 2 additions & 2 deletions ToolchainPlugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {
dependencies {
// For some utility classes. We don't actually apply EmbeddedTools to the FRCToolchain,
// but we do in GradleRIO
compile 'jaci.gradle:EmbeddedTools:2018.12.06a'
compile 'jaci.gradle:EmbeddedTools:2018.12.14'
compile 'de.undercouch:gradle-download-task:3.1.2'
}

Expand All @@ -42,4 +42,4 @@ gradlePlugin {
implementationClass = 'edu.wpi.first.toolchain.ToolchainPlugin'
}
}
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ archivesBaseName = "GradleRIO"

allprojects {
group = "edu.wpi.first"
version = "2019.1.1-beta-3b"
version = "2019.1.1-beta-4-pre2"

if (project.hasProperty('publishVersion')) {
version = project.publishVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class FRCNativeArtifact extends NativeArtifact {
def target = ip.host + ":" + debugPort
// def toolchainD = project.plugins.getPlugin(WPIToolchainPlugin.class).discoverRoborioToolchain()

def toolchainD = project.extensions.getByType(ToolchainExtension).getByName('roborio').discover()
def toolchainD = project.extensions.getByType(ToolchainExtension).getByName('roboRio').discover()
def gdbpath = toolchainD.gdbFile().get().absolutePath
def sysroot = toolchainD.sysroot().orElse(null).absolutePath

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,45 +186,51 @@ class WPINativeDepRules extends RuleSource {
} as Action<? extends CombinedNativeLib>)
}

// NI Libraries
libs.create('ni_chipobject_binaries', NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildTypes = ['debug', 'release']
lib.sharedMatchers = ['**/*.so*']
lib.dynamicMatchers = [] // NI Libs are not deployed to RRIO
lib.maven = "edu.wpi.first.ni-libraries:chipobject:${wpi.niLibrariesVersion}:${wpi.platforms.roborio}@zip"
lib.configuration = 'native_ni'
} as Action<? extends NativeLib>)

libs.create('ni_chipobject_headers', NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildTypes = ['debug', 'release']
lib.headerDirs << ''
lib.maven = "edu.wpi.first.ni-libraries:chipobject:${wpi.niLibrariesVersion}:headers@zip"
lib.configuration = 'native_ni'
} as Action<? extends NativeLib>)

libs.create('ni_netcomm_binaries', NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildTypes = ['debug', 'release']
lib.sharedMatchers = ['**/*.so*']
lib.dynamicMatchers = [] // NI Libs are not deployed to RRIO
lib.maven = "edu.wpi.first.ni-libraries:netcomm:${wpi.niLibrariesVersion}:${wpi.platforms.roborio}@zip"
lib.configuration = 'native_ni'
} as Action<? extends NativeLib>)

libs.create('ni_netcomm_headers', NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildTypes = ['debug', 'release']
lib.headerDirs << ''
lib.maven = "edu.wpi.first.ni-libraries:netcomm:${wpi.niLibrariesVersion}:headers@zip"
lib.configuration = 'native_ni'
} as Action<? extends NativeLib>)

['debug', ''].each { String buildKind ->
String buildType = buildKind.contains('debug') ? 'debug' : 'release'
String config = "native_ni${buildKind}".toString()

// NI Libraries
libs.create("ni_chipobject_binaries${buildKind}", NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildType = buildType
lib.libraryName = "ni_chipobject_binaries"
lib.sharedMatchers = ['**/*.so*']
lib.dynamicMatchers = [] // NI Libs are not deployed to RRIO
lib.maven = "edu.wpi.first.ni-libraries:chipobject:${wpi.niLibrariesVersion}:${wpi.platforms.roborio}${buildKind}@zip"
lib.configuration = config
} as Action<? extends NativeLib>)

libs.create("ni_netcomm_binaries${buildKind}", NativeLib, { NativeLib lib ->
common(lib)
lib.targetPlatforms << wpi.platforms.roborio
lib.buildType = buildType
lib.libraryName = "ni_netcomm_binaries"
lib.sharedMatchers = ['**/*.so*']
lib.dynamicMatchers = [] // NI Libs are not deployed to RRIO
lib.maven = "edu.wpi.first.ni-libraries:netcomm:${wpi.niLibrariesVersion}:${wpi.platforms.roborio}${buildKind}@zip"
lib.configuration = config
} as Action<? extends NativeLib>)

}

// Non-static combined libs
libs.create('ni_libraries', CombinedNativeLib, { CombinedNativeLib lib ->
lib.libs << 'ni_chipobject_binaries' << 'ni_chipobject_headers' << 'ni_netcomm_binaries' << 'ni_netcomm_headers'
Expand Down Expand Up @@ -278,23 +284,26 @@ class WPINativeDepRules extends RuleSource {
common(lib)
if (isShared) {
lib.sharedMatchers = ['**/shared/libopencv*.so.*']
lib.sharedExcludes = ['**/shared/libopencv*.so.*.debug', '**/shared/*java*']
lib.dynamicMatchers = lib.sharedMatchers
lib.dynamicExcludes = lib.sharedExcludes
} else {
matchersStatic(lib, 'opencv', false)
}
lib.targetPlatforms << NativePlatforms.roborio
lib.libraryName = "opencv${suf}_binaries"
lib.buildType = buildType
// TODO: This was meant to be debug but the matcher keeps grabbing .so.debug.
lib.maven = "${mavenRoot}:${NativePlatforms.roborio}${linkSuff}@zip"
lib.maven = "${mavenRoot}:${NativePlatforms.roborio}${linkSuff}${buildKind}@zip"
lib.configuration = config
} as Action<? extends NativeLib>)

libs.create("opencv${suf}_native${buildKind}".toString(), NativeLib, { NativeLib lib ->
common(lib)
if (isShared) {
lib.sharedMatchers = ['**/shared/*opencv*.so.*', '**/shared/*opencv*.*.dylib', '**/shared/*opencv*.lib']
lib.sharedExcludes = ['**/shared/libopencv*.so.*.debug', '**/shared/*java*']
lib.dynamicMatchers = lib.sharedMatchers + '**/shared/*opencv*.dll'
lib.dynamicExcludes = lib.sharedExcludes
} else {
matchersStatic(lib, 'opencv', true)
}
Expand All @@ -309,6 +318,9 @@ class WPINativeDepRules extends RuleSource {
common(lib)
if (isShared) {
lib.sharedMatchers = ['**/shared/*opencv*.so.*']
lib.sharedExcludes = ['**/shared/libopencv*.so.*.debug', '**/shared/*java*']
lib.dynamicMatchers = lib.sharedMatchers
lib.dynamicExcludes = lib.sharedExcludes
} else {
matchersStatic(lib, 'opencv', false)
}
Expand Down

0 comments on commit 5603d1f

Please sign in to comment.