Removes custom CONFIG_ATHENA compiler directive (#796)

In roborio GCC 5.5, __FRC_ROBORIO__ has been added directly to the
compiler. So we can instead use that to detect if we are build for the
roborio, and in a much more reliable way.
This commit is contained in:
Thad House
2017-12-08 21:40:11 -08:00
committed by Peter Johnson
parent 942ba51765
commit 8106fbdbea
9 changed files with 4 additions and 22 deletions

View File

@@ -5,17 +5,6 @@ apply plugin: 'edu.wpi.first.NativeUtils'
apply from: '../config.gradle'
ext.addHalCompilerArguments = { binary->
if (binary.targetPlatform.architecture.name == 'athena') {
tasks.withType(CppCompile) {
binary.cppCompiler.args "-DCONFIG_ATHENA"
}
}
tasks.withType(CppCompile) {
binary.cppCompiler.args "-DNAMESPACED_PRIORITY"
}
}
ext.addHalToLinker = { binary->
if (binary.targetPlatform.architecture.name == 'athena') {
binary.lib project: ':hal', library: 'halAthena', linkage: 'shared'
@@ -172,7 +161,6 @@ model {
}
binaries {
all {
project.addHalCompilerArguments(it)
project(':ni-libraries').addNiLibrariesToLinker(it)
}
withType(GoogleTestTestSuiteBinarySpec) {

View File

@@ -77,7 +77,7 @@ static inline int16_t getHandleTypedIndex(HAL_Handle handle,
HAL_HandleEnum enumType,
int16_t version) {
if (!isHandleType(handle, enumType)) return InvalidHandleIndex;
#if !defined(CONFIG_ATHENA)
#if !defined(__FRC_ROBORIO__)
if (!isHandleCorrectVersion(handle, version)) return InvalidHandleIndex;
#endif
return getHandleIndex(handle);

View File

@@ -66,7 +66,6 @@ model {
}
binaries.all { binary->
project(':ni-libraries').addNiLibrariesToLinker(binary)
project(':hal').addHalCompilerArguments(binary)
project(':hal').addHalToLinker(binary)
project(':wpilibc').addWpilibCCompilerArguments(binary)
project(':wpilibc').addWpilibCToLinker(binary)

View File

@@ -7,7 +7,7 @@
#include "IterativeRobot.h"
class MyRobot : public IterativeRobot {
class MyRobot : public frc::IterativeRobot {
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.

View File

@@ -51,7 +51,6 @@ if (!project.hasProperty('onlyAthena')) {
binaries {
all {
project(':hal').addHalCompilerArguments(it)
project(':hal').addHalToLinker(it)
}
}

View File

@@ -28,7 +28,6 @@ if (!project.hasProperty('onlyAthena')) {
binaries {
all {
project(':hal').addHalCompilerArguments(it)
project(':hal').addHalToLinker(it)
}
withType(StaticLibraryBinarySpec) {

View File

@@ -6,8 +6,8 @@ apply plugin: 'edu.wpi.first.NativeUtils'
apply from: '../config.gradle'
ext.addWpilibCCompilerArguments = { binary->
tasks.withType(CppCompile) {
binary.cppCompiler.args "-DNAMESPACED_WPILib"
binary.tasks.withType(CppCompile) {
binary.cppCompiler.args "-DNAMESPACED_WPILIB"
}
}
@@ -170,7 +170,6 @@ model {
tasks.withType(CppCompile) {
dependsOn generateCppVersion
}
project(':hal').addHalCompilerArguments(it)
project(':ni-libraries').addNiLibrariesToLinker(it)
project(':hal').addHalToLinker(it)
project.addWpilibCCompilerArguments(it)

View File

@@ -68,7 +68,6 @@ if (!project.hasProperty('skipAthena')) {
cppCompiler.args "-Wno-error=deprecated-declarations"
}
project(':ni-libraries').addNiLibrariesToLinker(binary)
project(':hal').addHalCompilerArguments(binary)
project(':hal').addHalToLinker(binary)
project(':wpilibc').addWpilibCCompilerArguments(binary)
project(':wpilibc').addWpilibCToLinker(binary)

View File

@@ -266,7 +266,6 @@ model {
}
binaries {
withType(NativeBinarySpec) {
project(':hal').addHalCompilerArguments(it)
project(':ni-libraries').addNiLibrariesToLinker(it)
}
withType(StaticLibraryBinarySpec) {