From 96f04d378b7747e1b80b49da7ae637eb33b23678 Mon Sep 17 00:00:00 2001 From: Pierre Pollastri Date: Mon, 14 May 2018 08:49:12 +0200 Subject: [PATCH] Update changelog and versions for first release --- CHANGELOG.md | 5 +++++ CMakeLists.txt | 4 ++-- README.md | 13 +++++++++++-- core/src/CMakeLists.txt | 3 +++ core/src/ledger-core.h | 12 ++++++++++-- 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..fdc3185888 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog +0.9.0 (2018-05-14) +================== + +First beta release of libledger-core for Ledger Vault integration \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 40e2a331cd..6d72531342 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ include(UseBackportedModules) # The project version number. set(VERSION_MAJOR 0 CACHE STRING "Project major version number.") -set(VERSION_MINOR 0 CACHE STRING "Project minor version number.") -set(VERSION_PATCH 1 CACHE STRING "Project patch version number.") +set(VERSION_MINOR 9 CACHE STRING "Project minor version number.") +set(VERSION_PATCH 0 CACHE STRING "Project patch version number.") mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build) diff --git a/README.md b/README.md index ae894a74c1..f612f3d6e4 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ git clone --recurse-submodules https://github.com/LedgerHQ/lib-ledger-core.git ## Dependencies ### Build -This project is based on **_cmake_** as a build system so you should install it before starting. +This project is based on **_cmake_** as a build system so you should install it before starting (at least version 3.7). ### External dependencies: -* [Qt5](https://www.qt.io/download) is needed to build the C++ library. +* [Qt5](https://www.qt.io/download) is needed to build tests of the library. * Generation of binding is automated with [Djinni](https://github.com/dropbox/djinni). * Build on multiple Operating Systems is based on [polly](https://github.com/ruslo/polly) toolchains. @@ -32,6 +32,15 @@ If you respect this folder structure (and naming), after `cd lib-ledger-core-bui cmake -DCMAKE_INSTALL_PREFIX=/path/to/qt5 ../lib-ledger-core && make ``` +### Building for JNI + +Building with JNI (Java Native Interface), allows you to use the library with Java based software. In order to enable JNI mode use +``` +cmake -DTARGET_JNI=ON +``` + +This will add JNI files to the library compilation and remove tests. You need at least a JDK 7 to build for JNI (OpenJDK or Oracle JDK) + ## Binding to node JS Generate binding (under `build/Release/ledgerapp_nodejs.node`): diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt index e231af03e4..12d5464a50 100644 --- a/core/src/CMakeLists.txt +++ b/core/src/CMakeLists.txt @@ -265,5 +265,8 @@ target_include_directories(ledger-core PUBLIC ../lib/cereal/) target_include_directories(ledger-core PUBLIC ../lib/date/) target_include_directories(ledger-core PUBLIC ../lib/secp256k1) +target_compile_definitions(ledger-core PRIVATE LIB_VERSION_MAJOR=${VERSION_MAJOR} LIB_VERSION_MINOR=${VERSION_MINOR} + LIB_VERSION_PATCH=${VERSION_PATCH}) + install(TARGETS ledger-core DESTINATION "lib") install(FILES ${LEDGER_CORE_API_HEADERS} DESTINATION "include/ledger-core") diff --git a/core/src/ledger-core.h b/core/src/ledger-core.h index c959678ca3..9245806680 100644 --- a/core/src/ledger-core.h +++ b/core/src/ledger-core.h @@ -31,6 +31,8 @@ #ifndef LEDGER_CORE_LEDGER_CORE_H #define LEDGER_CORE_LEDGER_CORE_H +#include + /** * Ledger root namespace */ @@ -41,8 +43,14 @@ namespace ledger { */ namespace core { - const int LIB_VERSION = 1; - const std::string LIB_STRING_VERSION = "1.0.0"; + const int LIB_VERSION = LIB_VERSION_MAJOR << 16 | LIB_VERSION_MINOR << 8 | LIB_VERSION_PATCH; + const int VERSION_MAJOR = LIB_VERSION_MAJOR; + const int VERSION_MINOR = LIB_VERSION_MINOR; + const int VERSION_PATCH = LIB_VERSION_PATCH; + const std::string LIB_STRING_VERSION = + BOOST_PP_STRINGIZE(LIB_VERSION_MAJOR) "." + BOOST_PP_STRINGIZE(LIB_VERSION_MINOR) "." + BOOST_PP_STRINGIZE(LIB_VERSION_PATCH); }