From c6634a8595ea05fda6157f2fd4f7b8c2f6523119 Mon Sep 17 00:00:00 2001 From: Martin Olivier Date: Wed, 18 Oct 2023 22:08:02 +0200 Subject: [PATCH] feat: v2.2.0 Signed-off-by: Martin Olivier --- .github/workflows/CI.yml | 6 +++--- CMakeLists.txt | 2 +- LICENSE | 2 +- README.md | 23 +++++++++-------------- example/CMakeLists.txt | 2 +- example/README.md | 11 +++++++++-- include/dylib.hpp | 4 ++-- tests/tests.cpp | 2 +- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dd98411..ac891a6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Generate project files run: cmake . -B build -G "${{ matrix.generator }}" -DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} -DDYLIB_BUILD_TESTS=ON -DDYLIB_WARNING_AS_ERRORS=ON @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Update packages run: sudo apt update @@ -97,7 +97,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install cpplint run: pip install cpplint diff --git a/CMakeLists.txt b/CMakeLists.txt index 66bccc8..6f9689a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ endif() set(CPACK_PACKAGE_NAME "dylib") set(CPACK_PACKAGE_VENDOR "Martin Olivier") set(CPACK_PACKAGE_VERSION_MAJOR "2") -set(CPACK_PACKAGE_VERSION_MINOR "1") +set(CPACK_PACKAGE_VERSION_MINOR "2") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") set(CPACK_PACKAGE_DESCRIPTION "C++ cross-platform wrapper around dynamic loading of shared libraries") diff --git a/LICENSE b/LICENSE index 1cc14c8..6000446 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Martin Olivier +Copyright (c) 2023 Martin Olivier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d643443..95dfb3f 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,19 @@

-dylib

+ dylib

- - version - + + version - license - + license - cppversion - + cppversion

- ci - + ci - codecov - + codecov

The goal of this C++ library is to load dynamic libraries (.so, .dll, .dylib) and access its functions and global variables at runtime. @@ -37,13 +32,13 @@ include(FetchContent) FetchContent_Declare( dylib GIT_REPOSITORY "https://github.com/martin-olivier/dylib" - GIT_TAG "v2.1.0" + GIT_TAG "v2.2.0" ) FetchContent_MakeAvailable(dylib) ``` -You can also click [HERE](https://github.com/martin-olivier/dylib/releases/download/v2.1.0/dylib.hpp) to download the `dylib` header file. +You can also click [HERE](https://github.com/martin-olivier/dylib/releases/download/v2.2.0/dylib.hpp) to download the `dylib` header file. # Documentation diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index f60ad2f..69c636c 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -15,7 +15,7 @@ include(FetchContent) FetchContent_Declare( dylib GIT_REPOSITORY "https://github.com/martin-olivier/dylib" - GIT_TAG "v2.1.0" + GIT_TAG "v2.2.0" ) FetchContent_MakeAvailable(dylib) diff --git a/example/README.md b/example/README.md index fa76f0c..7f43b64 100644 --- a/example/README.md +++ b/example/README.md @@ -1,8 +1,9 @@ -# Dylib example +# dylib example Here is an example about the usage of the `dylib` library in a project The functions and variables of our forthcoming dynamic library are located inside [lib.cpp](lib.cpp) + ```c++ // lib.cpp @@ -31,6 +32,7 @@ LIB_EXPORT void print_hello() { ``` The code that will load functions and global variables of our dynamic library at runtime is located inside [main.cpp](main.cpp) + ```c++ // main.cpp @@ -57,11 +59,13 @@ int main() { ``` Then, we want a build system that will: + - Fetch `dylib` into the project - Build [lib.cpp](lib.cpp) into a dynamic library - Build [main.cpp](main.cpp) into an executable This build system is located inside [CMakeLists.txt](CMakeLists.txt) + ```cmake # CMakeLists.txt @@ -82,7 +86,7 @@ include(FetchContent) FetchContent_Declare( dylib GIT_REPOSITORY "https://github.com/martin-olivier/dylib" - GIT_TAG "v2.1.0" + GIT_TAG "v2.2.0" ) FetchContent_MakeAvailable(dylib) @@ -99,12 +103,14 @@ target_link_libraries(dylib_example PRIVATE dylib) Let's build our code: > Make sure to type the following commands inside the `example` folder + ```sh cmake . -B build cmake --build build ``` Let's run our code: + ```sh # on unix, run the following command inside "build" folder ./dylib_example @@ -114,6 +120,7 @@ Let's run our code: ``` You will have the following result: + ```sh 15 Hello diff --git a/include/dylib.hpp b/include/dylib.hpp index 06c8292..85bbadf 100644 --- a/include/dylib.hpp +++ b/include/dylib.hpp @@ -1,11 +1,11 @@ /** * @file dylib.hpp - * @version 2.1.0 + * @version 2.2.0 * @brief C++ cross-platform wrapper around dynamic loading of shared libraries * @link https://github.com/martin-olivier/dylib * * @author Martin Olivier - * @copyright (c) 2022 Martin Olivier + * @copyright (c) 2023 Martin Olivier * * This library is released under MIT license */ diff --git a/tests/tests.cpp b/tests/tests.cpp index 7377c0d..4906507 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -2,7 +2,7 @@ #include #include "dylib.hpp" -TEST(exemple, exemple_test) { +TEST(example, example_test) { testing::internal::CaptureStdout(); dylib lib("./", "dynamic_lib");