Skip to content

Instantly share code, notes, and snippets.

@PeterMitrano
Created July 29, 2015 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterMitrano/7650470cf5c57a27fab9 to your computer and use it in GitHub Desktop.
Save PeterMitrano/7650470cf5c57a27fab9 to your computer and use it in GitHub Desktop.
// There are two hal libraries that are built
// - Desktop hal which is used by simulation (gcc/msvc)
// - Athena hal which is used by the roborio (arm)
apply plugin: 'cpp'
model {
platforms {
arm {
architecture "arm"
}
x86_64 {
architecture "x86_64"
}
}
components {
HALShared(NativeLibrarySpec) {
targetPlatform 'arm'
targetPlatform 'x86_64'
binaries.all {
if (toolChain in Gcc){
cppCompiler.args "-std=c++1y"
}
}
sources {
cpp {
source {
srcDirs = ["lib/Shared"]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["include", "lib/Shared"]
}
}
}
}
HALAthena(NativeLibrarySpec) {
targetPlatform 'arm'
tasks.withType(CppCompile) {
dependsOn addNiLibraryLinks
}
sources {
cpp {
source {
srcDirs = ["lib/Athena", "lib/Athena/FRC_FPGA_ChipObject"]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["include", "lib/Athena", "lib/Athena/FRC_FPGA_ChipObject"]
}
lib library: 'HALShared', linkage: 'static'
}
}
}
HALDesktop(NativeLibrarySpec) {
targetPlatform 'x86_64'
sources {
cpp {
source {
srcDirs = ["lib/Desktop"]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["include", "lib/Desktop"]
}
lib library: 'HALShared', linkage: 'static'
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment