From f2751db5c21264d121c562120248a1d5bd39b817 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sat, 22 Oct 2016 14:21:26 -0700 Subject: [PATCH] Adds NI Libraries symbolic link (#286) --- cppSettings.gradle | 23 +++-------------------- ni-libraries/libnilibraries.so | 3 +++ ni-libraries/libwpi.so | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) create mode 100644 ni-libraries/libnilibraries.so diff --git a/cppSettings.gradle b/cppSettings.gradle index 573d90ab76..d6805c9471 100644 --- a/cppSettings.gradle +++ b/cppSettings.gradle @@ -1,23 +1,6 @@ -// This regex matches either a Windows or Unix style file separator, then the lib part of the library, -// then the name of the library itself, and finally the .so extension at the end. The name of the library -// is in the libName capture group, which is extracted and used for the linker flags -def libPattern = /.*((\\/|\\).*)+lib(?.+).so$/ -def niLibraryArgs = [] +// These add the nilibraries shared library to the linker args def niLibraryPath = file('ni-libraries').path - -// The NI Library tree includes all non-wpi libraries, which is everything that doesn't have libwpi in the name -def niLibraryTree = fileTree(niLibraryPath) -niLibraryTree.include '*.so' -niLibraryTree.exclude '*wpi*.so' - -// This adds all linker flags to the list of ni library linker flags -niLibraryTree.each { lib -> - def nameMatcher = (lib.path =~ libPattern) - if (nameMatcher[0].size() > 1) { - def name = nameMatcher.group('libName') - niLibraryArgs << '-l' + name - } -} +def niLibrary = niLibraryPath + "/libnilibraries.so" task downloadArmNetworkTables() { description = 'Downloads the C++ ARM NetworkTables maven dependency.' @@ -274,7 +257,7 @@ subprojects { String architecture = targetPlatform.architecture if (architecture.contains('arm')){ linker.args << '-L' + niLibraryPath - linker.args.addAll(niLibraryArgs) + linker.args niLibrary } } } diff --git a/ni-libraries/libnilibraries.so b/ni-libraries/libnilibraries.so new file mode 100644 index 0000000000..e77e67acda --- /dev/null +++ b/ni-libraries/libnilibraries.so @@ -0,0 +1,3 @@ +/* GNU ld script */ +OUTPUT_FORMAT(elf32-littlearm) +GROUP ( AS_NEEDED ( -lFRC_NetworkCommunication -li2c -lni_emb -lNiFpgaLv -lNiFpga -lnirio_emb_can -lNiRioSrv -lni_rtlog -lRoboRIO_FRC_ChipObject -lspi -lvisa -ldl -lpthread -lrt -lGCBase_gcc-4.4-arm_v3_0_NI -lGenApi_gcc-4.4-arm_v3_0_NI -lLog_gcc-4.4-arm_v3_0_NI -lMathParser_gcc-4.4-arm_v3_0_NI -llog4cpp_gcc-4.4-arm_v3_0_NI -lniimaqdx -lnivision -lnivissvc -lnipalu -lNodeMapData_gcc-4.4-arm_v3_0_NI -lXmlParser_gcc-4.4-arm_v3_0_NI -lavcodec -lavformat -lavutil -lniriodevenum -lniriosession -lswscale) ) diff --git a/ni-libraries/libwpi.so b/ni-libraries/libwpi.so index 0a110ded13..d262dea8c2 100644 --- a/ni-libraries/libwpi.so +++ b/ni-libraries/libwpi.so @@ -1,3 +1,3 @@ /* GNU ld script */ OUTPUT_FORMAT(elf32-littlearm) -GROUP ( AS_NEEDED ( -lwpilib_nonshared -lHALAthena -lntcore -lwpiutil -lFRC_NetworkCommunication -li2c -lni_emb -lNiFpgaLv -lNiFpga -lnirio_emb_can -lNiRioSrv -lni_rtlog -lRoboRIO_FRC_ChipObject -lspi -lvisa -ldl -lpthread -lrt -lGCBase_gcc-4.4-arm_v3_0_NI -lGenApi_gcc-4.4-arm_v3_0_NI -lLog_gcc-4.4-arm_v3_0_NI -lMathParser_gcc-4.4-arm_v3_0_NI -llog4cpp_gcc-4.4-arm_v3_0_NI -lniimaqdx -lnivision -lnivissvc -lnipalu -lNodeMapData_gcc-4.4-arm_v3_0_NI -lXmlParser_gcc-4.4-arm_v3_0_NI -lavcodec -lavformat -lavutil -lniriodevenum -lniriosession -lswscale) ) +GROUP ( AS_NEEDED ( -lwpilib_nonshared -lHALAthena -lntcore -lwpiutil -lnilibraries ) )