diff --git a/myRobotCpp/build.gradle b/myRobotCpp/build.gradle index c37e170270..72bdb0a177 100644 --- a/myRobotCpp/build.gradle +++ b/myRobotCpp/build.gradle @@ -38,5 +38,37 @@ model { } } } + + // Shared target used just to check that wpilib is fully linked + // Use the static target for normal linking + myRobotcppShared(NativeExecutableSpec) { + targetPlatform 'arm' + binaries.all { + tasks.withType(CppCompile) { + addNiLibraryLinks(linker, targetPlatform) + addNetworkTablesLibraryLinks(it, linker, targetPlatform) + } + + cppCompiler.args '-pthread', '-Wno-unused-variable' + linker.args '-pthread', '-Wno-unused-variable', '-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a' + } + sources { + cpp { + source { + srcDir 'src' + include '**/*.cpp' + } + exportedHeaders { + srcDirs = ['include', + "${project.athena}/include", "${project.shared}/include", + "${project.hal}/include/HAL", netTablesInclude, wpiUtilInclude] + include '**/*.h' + } + + lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared' + lib project: ':hal', library: 'HALAthena', linkage: 'shared' + } + } + } } } diff --git a/wpilibc/athena/src/Ultrasonic.cpp b/wpilibc/athena/src/Ultrasonic.cpp index e16be59bd4..673e9c68e4 100644 --- a/wpilibc/athena/src/Ultrasonic.cpp +++ b/wpilibc/athena/src/Ultrasonic.cpp @@ -28,6 +28,7 @@ constexpr double Ultrasonic::kSpeedOfSoundInchesPerSec; // automatic round robin mode std::atomic Ultrasonic::m_automaticEnabled{false}; std::set Ultrasonic::m_sensors; +std::thread Ultrasonic::m_thread; /** * Background task that goes through the list of ultrasonic sensors and pings