mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Update build setup for raspbian and debug binaries (#1384)
- Build both debug and release binaries - Append "d" to debug libraries in the style of opencv - Split shared and static classifiers - Add raspbian support
This commit is contained in:
committed by
Peter Johnson
parent
8ff81f5a2a
commit
a8aacd3657
@@ -52,6 +52,7 @@ model {
|
||||
servo(NativeLibrarySpec)
|
||||
drive_motor(NativeLibrarySpec)
|
||||
all { component ->
|
||||
component.targetBuildTypes 'debug'
|
||||
sources {
|
||||
cpp.lib library: "${component.name}", linkage: "static"
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
// By default, a development executable will be generated. This is to help the case of
|
||||
// testing specific functionality of the library.
|
||||
"${nativeName}Dev"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
@@ -125,13 +126,17 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
}
|
||||
binaries {
|
||||
withType(GoogleTestTestSuiteBinarySpec) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
} else {
|
||||
it.buildable = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,7 +147,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
model {
|
||||
|
||||
testSuites {
|
||||
if (!project.hasProperty('onlyAthena')) {
|
||||
if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
|
||||
"${nativeName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : $.components) {
|
||||
if (c.name == nativeName) {
|
||||
|
||||
@@ -49,13 +49,7 @@ addTaskToCopyAllOutputs(cppHeadersZip)
|
||||
|
||||
model {
|
||||
publishing {
|
||||
def halsim_adx_gyro_accelerometerTaskList = createComponentZipTasks($.components, nativeName, zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
def allTask
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
allTask = createAllCombined(halsim_adx_gyro_accelerometerTaskList, nativeName, zipBaseName, Zip, project)
|
||||
}
|
||||
|
||||
|
||||
def halsim_adx_gyro_accelerometerTaskList = createComponentZipTasks($.components, [nativeName], zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
|
||||
publications {
|
||||
cpp(MavenPublication) {
|
||||
@@ -63,10 +57,6 @@ model {
|
||||
artifact it
|
||||
}
|
||||
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
artifact allTask
|
||||
}
|
||||
|
||||
artifact cppHeadersZip
|
||||
artifact cppSourcesZip
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
model {
|
||||
testSuites {
|
||||
def comps = $.components
|
||||
if (!project.hasProperty('onlyAthena')) {
|
||||
if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
|
||||
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : comps) {
|
||||
if (c.name == pluginName) {
|
||||
|
||||
@@ -57,7 +57,11 @@ void DSCommPacket::ReadMatchtimeTag(wpi::ArrayRef<uint8_t> tagData) {
|
||||
store |= tagData[4] << 8;
|
||||
store |= tagData[5];
|
||||
|
||||
float matchTime = *reinterpret_cast<float*>(&store);
|
||||
static_assert(sizeof(uint32_t) == sizeof(float), "float must be 32 bits");
|
||||
|
||||
float matchTime = 0;
|
||||
|
||||
std::memcpy(&matchTime, &store, sizeof(float));
|
||||
m_match_time = matchTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
// By default, a development executable will be generated. This is to help the case of
|
||||
// testing specific functionality of the library.
|
||||
"${nativeName}Dev"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
@@ -149,7 +150,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
model {
|
||||
|
||||
testSuites {
|
||||
if (!project.hasProperty('onlyAthena')) {
|
||||
if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
|
||||
"${nativeName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : $.components) {
|
||||
if (c.name == nativeName) {
|
||||
|
||||
@@ -50,13 +50,7 @@ addTaskToCopyAllOutputs(cppHeadersZip)
|
||||
|
||||
model {
|
||||
publishing {
|
||||
def lowfiSimTaskList = createComponentZipTasks($.components, nativeName, zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
def allTask
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
allTask = createAllCombined(lowfiSimTaskList, nativeName, zipBaseName, Zip, project)
|
||||
}
|
||||
|
||||
|
||||
def lowfiSimTaskList = createComponentZipTasks($.components, [nativeName], zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
|
||||
publications {
|
||||
cpp(MavenPublication) {
|
||||
@@ -64,10 +58,6 @@ model {
|
||||
artifact it
|
||||
}
|
||||
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
artifact allTask
|
||||
}
|
||||
|
||||
artifact cppHeadersZip
|
||||
artifact cppSourcesZip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user