diff options
author | Sven Göthel <[email protected]> | 2024-05-26 04:46:29 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-05-26 04:46:29 +0200 |
commit | 322d95ed133f90d7c77fb66a5b942929f6a03c1d (patch) | |
tree | 1b981e01598bb08a25f806ad57a9b8dd35e0b265 | |
parent | 6ecea580940de66b85e692931c33497160ff389a (diff) |
Adopt to jaulib: clangd/cland-tidy integration; Use VersionNumberv1.2.2
-rw-r--r-- | .clang-tidy | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | cmake/modules/clangd.in | 2 | ||||
-rw-r--r-- | cmake/modules/version.cpp.in | 2 | ||||
-rw-r--r-- | examples/cipherpack/commandline.cpp | 2 | ||||
-rw-r--r-- | include/cipherpack/version.hpp | 4 | ||||
-rw-r--r-- | java/jni/cipherpack/CPFactory.cxx | 4 | ||||
-rw-r--r-- | test/cipherpack/CMakeLists.txt | 1 |
8 files changed, 12 insertions, 10 deletions
diff --git a/.clang-tidy b/.clang-tidy index 407aca4..7211f7f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -16,7 +16,7 @@ CheckOptions: value: 'true' WarningsAsErrors: '*' -HeaderFilterRegex: '(include/cipherpack/.*|jaulib/include/jau/[a-zA-Z0-0]*|jaulib/include/jau/jni/[a-zA-Z0-0]*)\.hpp' +HeaderFilterRegex: '(include/cipherpack/.*|jaulib/include/jau/.*)\.hpp' # AnalyzeTemporaryDtors: false FormatStyle: none InheritParentConfig: false diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc50e3..6f43079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,9 @@ JaulibSetup() if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.clangd) # Fixup clangd w/ absolute path -set (cipherpack_clangd_source_args "-isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/include, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/src, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/java_jni/jni, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/java_jni/jni/jau, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/test") -set (cipherpack_clangd_source_args "${cipherpack_clangd_source_args} -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/include, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/src/cipherpack, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/java/jni, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/java/jni/cipherpack, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/test/cipherpack") +set (cipherpack_clangd_source_args "-isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/include, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/src, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/java_jni/jni, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/java_jni/jni/jau") +set (cipherpack_clangd_source_args "${cipherpack_clangd_source_args}, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/include/catch2_jau, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/jaulib/test") +set (cipherpack_clangd_source_args "${cipherpack_clangd_source_args}, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/include, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/src/cipherpack, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/java/jni, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/java/jni/cipherpack, -isystem, ${CMAKE_CURRENT_SOURCE_DIR}/test/cipherpack") configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/clangd.in ${CMAKE_CURRENT_SOURCE_DIR}/.clangd) endif() diff --git a/cmake/modules/clangd.in b/cmake/modules/clangd.in index e6a4008..368585d 100644 --- a/cmake/modules/clangd.in +++ b/cmake/modules/clangd.in @@ -15,7 +15,7 @@ # Tell clangd to use the compile_commands.json file in the build/default folder CompileFlags: CompilationDatabase: @CMAKE_CURRENT_BINARY_DIR@ - Add: [@cipherpack_clangd_source_args@] + Add: [@cxx_clangd_flags@, @cipherpack_clangd_source_args@] Diagnostics: UnusedIncludes: Strict diff --git a/cmake/modules/version.cpp.in b/cmake/modules/version.cpp.in index a81671d..d49601d 100644 --- a/cmake/modules/version.cpp.in +++ b/cmake/modules/version.cpp.in @@ -1,5 +1,5 @@ #include <cipherpack/version.hpp> -const char* cipherpack::VERSION = "@cipherpack_VERSION_LONG@"; +const jau::util::VersionNumber cipherpack::VERSION("@cipherpack_VERSION_LONG@"); const char* cipherpack::VERSION_SHORT = "@cipherpack_VERSION_SHORT@"; const char* cipherpack::VERSION_API = "@cipherpack_VERSION_API@"; diff --git a/examples/cipherpack/commandline.cpp b/examples/cipherpack/commandline.cpp index 51a7776..35878f9 100644 --- a/examples/cipherpack/commandline.cpp +++ b/examples/cipherpack/commandline.cpp @@ -92,7 +92,7 @@ class LoggingCipherpackListener : public cipherpack::CipherpackListener { typedef std::shared_ptr<LoggingCipherpackListener> LoggingCipherpackListenerRef; static void print_version() { - fprintf(stderr, "Cipherpack Native Version %s (API %s)\n", cipherpack::VERSION, cipherpack::VERSION_API); + fprintf(stderr, "Cipherpack Native Version %s (API %s)\n", cipherpack::VERSION.toString().c_str(), cipherpack::VERSION_API); } static void print_usage(const char* progname) { diff --git a/include/cipherpack/version.hpp b/include/cipherpack/version.hpp index c094929..7e785d1 100644 --- a/include/cipherpack/version.hpp +++ b/include/cipherpack/version.hpp @@ -26,9 +26,11 @@ #ifndef JAU_CIPHERPACK_VERSION_HPP_ #define JAU_CIPHERPACK_VERSION_HPP_ +#include <jau/util/VersionNumber.hpp> + namespace cipherpack { - extern const char* VERSION; + extern const jau::util::VersionNumber VERSION; extern const char* VERSION_SHORT; extern const char* VERSION_API; diff --git a/java/jni/cipherpack/CPFactory.cxx b/java/jni/cipherpack/CPFactory.cxx index dac2f92..f13ef3d 100644 --- a/java/jni/cipherpack/CPFactory.cxx +++ b/java/jni/cipherpack/CPFactory.cxx @@ -33,9 +33,7 @@ jstring Java_org_cipherpack_CPFactory_getNativeVersion(JNIEnv *env, jclass clazz { try { (void) clazz; - - std::string api_version = std::string(cipherpack::VERSION); - return env->NewStringUTF(api_version.c_str()); + return env->NewStringUTF(cipherpack::VERSION.versionString().c_str()); } catch(...) { rethrow_and_raise_java_exception(env); } diff --git a/test/cipherpack/CMakeLists.txt b/test/cipherpack/CMakeLists.txt index 18a29aa..c07451e 100644 --- a/test/cipherpack/CMakeLists.txt +++ b/test/cipherpack/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories( ${PROJECT_SOURCE_DIR}/jaulib/include + ${PROJECT_SOURCE_DIR}/jaulib/include/catch2_jau ${AMALGAMATION_ARCH_INC} ${PROJECT_SOURCE_DIR}/include ) |