[build] Disable Gazebo builds when -PmakeSim is not set (#2810)

This commit is contained in:
Prateek Machiraju
2020-11-09 11:37:10 -05:00
committed by GitHub
parent 0dfee4745c
commit f24f282442
3 changed files with 23 additions and 25 deletions

View File

@@ -21,16 +21,14 @@ try {
gazebo_linker_args = "pkg-config --libs gazebo protobuf".execute().text.split()
} catch(Exception ex) { }
if (!gazebo_version?.trim()) {
println "Gazebo development files are not available. (pkg-config --modversion gazebo failed)"
if (project.hasProperty("makeSim")) {
/* Force the build even though we did not find protobuf. */
if (project.hasProperty("makeSim")) {
if (!gazebo_version?.trim()) {
println "Gazebo development files are not available. (pkg-config --modversion gazebo failed)"
println "makeSim set. Forcing build - failure likely."
}
else {
ext.skip_frc_plugins = true
println "Skipping FRC Plugins."
}
} else {
ext.skip_frc_plugins = true
println "Skipping FRC Plugins."
}
evaluationDependsOn(":simulation:gz_msgs")

View File

@@ -26,17 +26,14 @@ try {
} catch(Exception ex) {
}
if (!protobuf_version?.trim()) {
println "Protobuf is not available. (pkg-config --modversion protobuf failed)"
protobuf_version = "+"
if (project.hasProperty("makeSim")) {
/* Force the build even though we did not find protobuf. */
if (project.hasProperty("makeSim")) {
if (!protobuf_version?.trim()) {
println "Protobuf is not available. (pkg-config --modversion protobuf failed)"
println "makeSim set. Forcing build - failure likely."
}
else {
ext.skip_gz_msgs = true
println "Skipping gz_msgs."
}
} else {
ext.skip_gz_msgs = true
println "Skipping gz msgs."
}
tasks.whenTaskAdded { task ->
@@ -88,6 +85,11 @@ model {
binaries {
all {
cppCompiler.args "-fPIC"
// Disable -Wzero-length-array on Clang
if (it.targetPlatform.operatingSystem.isMacOsX()) {
it.cppCompiler.args.add('-Wno-error=zero-length-array')
}
}
}
}

View File

@@ -19,16 +19,14 @@ try {
gazebo_linker_args = "pkg-config --libs gazebo protobuf".execute().text.split()
} catch(Exception ex) { }
if (!gazebo_version?.trim()) {
println "Gazebo development files are not available. (pkg-config --modversion gazebo failed)"
if (project.hasProperty("makeSim")) {
/* Force the build even though we did not find protobuf. */
if (project.hasProperty("makeSim")) {
if (!gazebo_version?.trim()) {
println "Gazebo development files are not available. (pkg-config --modversion gazebo failed)"
println "makeSim set. Forcing build - failure likely."
}
else {
ext.skip_frc_plugins = true
println "Skipping FRC Plugins."
}
} else {
ext.skip_frc_plugins = true
println "Skipping FRC Plugins."
}
evaluationDependsOn(":simulation:gz_msgs")