diff options
author | Sven Gothel <[email protected]> | 2020-12-21 12:39:33 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-12-21 12:39:33 +0100 |
commit | e56940759c4f29f31cc29c67c05e12a9fc836db2 (patch) | |
tree | bc95accebb49d51abf10ac0f9525747b3b3975bd | |
parent | 7a5886cc138971f67de3fb4ba95227ee87ffd437 (diff) |
Move jaucpp -> jaulib; Full integration of jaulib's unit tests (TODO: Use Catch2 for own unit tests)
Also: cmake: Add "null-dereference" to NO_ERROR, as it causes trouble with jau::get_uint8(..) with "-O3"
See jaulib commit db34007f905dab9feeba16e95c16d84bfb0ff11a
-rw-r--r-- | .classpath | 1 | ||||
-rw-r--r-- | .cproject | 22 | ||||
-rw-r--r-- | .gitmodules | 6 | ||||
-rw-r--r-- | .settings/language.settings.xml | 4 | ||||
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | README.md | 4 | ||||
m--------- | jaucpp | 0 | ||||
m--------- | jaulib | 0 | ||||
-rwxr-xr-x | scripts/build-doc.sh | 44 | ||||
-rw-r--r-- | test/direct_bt/test_btaddress01.cpp (renamed from test/direct_bt/test_basictypes01.cpp) | 0 |
10 files changed, 65 insertions, 21 deletions
@@ -2,6 +2,7 @@ <classpath> <classpathentry kind="src" path="examples/java"/> <classpathentry kind="src" path="java"/> + <classpathentry kind="src" path="jaulib/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_121"/> <classpathentry kind="output" path="build-eclipse-amd64/"/> </classpath> @@ -37,7 +37,7 @@ <option id="gnu.cpp.compiler.option.debugging.sanitundef.736032567" name="Sanitize undefined behavior (-fsanitize=undefined)" superClass="gnu.cpp.compiler.option.debugging.sanitundef" useByScannerDiscovery="false" value="false" valueType="boolean"/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.96858701" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value="/usr/include/c++/10/"/> - <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaucpp/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaulib/include}""/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/"/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/linux/"/> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/api/direct_bt}""/> @@ -82,7 +82,7 @@ <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.549699448" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/include}""/> </option> - <option id="gnu.c.compiler.option.misc.pic.111957654" superClass="gnu.c.compiler.option.misc.pic" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="gnu.c.compiler.option.misc.pic.111957654" name="Position Independent Code (-fPIC)" superClass="gnu.c.compiler.option.misc.pic" useByScannerDiscovery="false" value="true" valueType="boolean"/> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1736735651" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.so.debug.304323896" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.debug"> @@ -91,7 +91,7 @@ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.603785955" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug"> <option defaultValue="true" id="gnu.cpp.link.so.debug.option.shared.486082612" name="Shared (-shared)" superClass="gnu.cpp.link.so.debug.option.shared" useByScannerDiscovery="false" value="false" valueType="boolean"/> <option id="gnu.cpp.link.option.pthread.104045313" name="Support for pthread (-pthread)" superClass="gnu.cpp.link.option.pthread" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.1150246641" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs"> + <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.1150246641" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs"> <listOptionValue builtIn="false" value="unwind"/> </option> <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.503379509" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> @@ -105,7 +105,7 @@ </tool> </toolChain> </folderInfo> - <folderInfo id="cdt.managedbuild.config.gnu.so.debug.368873367.842993498" name="/" resourcePath="jaucpp"> + <folderInfo id="cdt.managedbuild.config.gnu.so.debug.368873367.842993498" name="/" resourcePath="jaulib"> <toolChain id="cdt.managedbuild.toolchain.gnu.so.debug.779868031" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.so.debug" unusedChildren=""> <targetPlatform id="cdt.managedbuild.target.gnu.platform.so.debug" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.so.debug"/> <tool id="cdt.managedbuild.tool.gnu.archiver.base.417167386" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base.704612215"/> @@ -114,7 +114,7 @@ </tool> <tool id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.306787993" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug.1384284733"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1717870340" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaucpp/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaulib/include}""/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/"/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/linux/"/> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/api/direct_bt}""/> @@ -128,7 +128,7 @@ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.407141367" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.603785955"/> <tool id="cdt.managedbuild.tool.gnu.assembler.so.debug.188335344" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.debug.21349791"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1517626135" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> - <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaucpp/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaulib/include}""/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/"/> <listOptionValue builtIn="false" value="/opt-linux-x86_64/jdk1.8.0_121/include/linux/"/> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/api/direct_bt}""/> @@ -143,13 +143,9 @@ <sourceEntries> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="api/direct_bt"/> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="api/ieee11073"/> - <entry excluding="direct_bt/|tinyb/" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="build-amd64/src"/> + <entry excluding="tinyb/|direct_bt/" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="build-amd64/src"/> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="examples/direct_bt_scanner10"/> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="include/cppunit"/> - <entry excluding="jau" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="jaucpp/include"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="jaucpp/include/jau"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="jaucpp/java/jni"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="jaucpp/src"/> <entry excluding="tinyb/" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="java/jni"/> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/direct_bt"/> <entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/ieee11073"/> @@ -189,7 +185,7 @@ <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.574040271" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/api/direct_bt}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/include/cppunit}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaucpp/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/direct_bt/jaulib/include}""/> </option> <option id="gnu.cpp.compiler.option.dialect.std.216768146" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++17" valueType="enumerated"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.717986153" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> @@ -256,4 +252,4 @@ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> </storageModule> -</cproject>
\ No newline at end of file +</cproject> diff --git a/.gitmodules b/.gitmodules index 2eea284b..7b5e759f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "jaucpp"] - path = jaucpp - url = ../jaucpp +[submodule "jaulib"] + path = jaulib + url = ../jaulib diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 4f1acb3d..3ecb3a4d 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> - <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1600333629623864548" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> + <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1600508545218648548" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> <language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.g++"/> </provider> @@ -16,7 +16,7 @@ <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> - <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1566284796311381920" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> + <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1566459711906165920" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> <language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.g++"/> </provider> diff --git a/CMakeLists.txt b/CMakeLists.txt index f6ffa86e..2d7ce2c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,8 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CC_FLAGS_WARNING "-Wall -Wextra -Werror") set (GCC_FLAGS_WARNING_FORMAT "-Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k") set (GCC_FLAGS_WARNING "-Wall -Wextra -Wshadow -Wtype-limits -Wsign-compare -Wcast-align=strict -Wnull-dereference -Winit-self ${GCC_FLAGS_WARNING_FORMAT} -Werror") -set (GCC_FLAGS_WARNING_NO_ERROR "-Wno-error=array-bounds") +# causes issues in jau::get_int8(..): "-Wnull-dereference" +set (GCC_FLAGS_WARNING_NO_ERROR "-Wno-error=array-bounds -Werror -Wno-error=null-dereference") # too pedantic, but nice to check once in a while # set (DISABLED_CC_FLAGS_WARNING "-Wsign-conversion") @@ -134,6 +135,8 @@ set (tinyb_DOCS_DIR documentation) find_path (SYSTEM_USR_DIR "stdlib.h") include_directories (${SYSTEM_USR_DIR}) +add_subdirectory (jaucpp) + add_subdirectory (src/direct_bt) if(NOT SKIP_TINYB) @@ -168,7 +168,7 @@ Up to date API documentation can be found: * [Java API Doc](https://jausoft.com/projects/direct_bt/build/documentation/java/html/index.html). -* [Jau C++ Standalone API Doc](https://jausoft.com/projects/jaucpp/build/documentation/cpp/html/index.html). +* [jaulib Standalone C++ API Doc](https://jausoft.com/projects/jaulib/build/documentation/cpp/html/index.html). A guide for getting started with *Direct-BT* on C++ and Java may follow up. @@ -227,7 +227,7 @@ Building Binaries The project requires CMake 3.13+ for building and a Java JDK >= 11. -This project also uses the [Jau C++ Library](https://jausoft.com/cgit/jaucpp.git/about/) +This project also uses the [Jau Library](https://jausoft.com/cgit/jaulib.git/about/) as a git submodule, which has been extracted earlier from this project to better encapsulation and allow general use. diff --git a/jaucpp b/jaucpp deleted file mode 160000 -Subproject 19f1d05cda6a809541f9b17397dd3830b2e3f32 diff --git a/jaulib b/jaulib new file mode 160000 +Subproject c71c4166aeb11ca32b888b42bd79d408bb328f4 diff --git a/scripts/build-doc.sh b/scripts/build-doc.sh new file mode 100755 index 00000000..152ec18c --- /dev/null +++ b/scripts/build-doc.sh @@ -0,0 +1,44 @@ +#! /bin/sh + +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` +logfile=$bname.log +rm -f $logfile + +. $sdir/setup-machine-arch.sh + +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-$archabi +if [ ! -e $JAVA_HOME ] ; then + echo $JAVA_HOME does not exist + exit 1 +fi + +buildit() { + echo rootdir $rootdir + echo logfile $logfile + echo CPU_COUNT $CPU_COUNT + + cd $rootdir + rm -rf dist-$archabi + mkdir -p dist-$archabi/bin + rm -rf build-$archabi + mkdir -p build-$archabi + cd build-$archabi + # CLANG_ARGS="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++" + cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON .. + # cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON .. + make -j $CPU_COUNT install test doc + if [ $? -eq 0 ] ; then + echo "BUILD SUCCESS $bname $archabi" + cp -a examples/* $rootdir/dist-$archabi/bin + cd $rootdir + return 0 + else + echo "BUILD FAILURE $bname $archabi" + cd $rootdir + return 1 + fi +} + +buildit 2>&1 | tee $logfile diff --git a/test/direct_bt/test_basictypes01.cpp b/test/direct_bt/test_btaddress01.cpp index 0952511f..0952511f 100644 --- a/test/direct_bt/test_basictypes01.cpp +++ b/test/direct_bt/test_btaddress01.cpp |