Skip to content

Commit

Permalink
feat: v2.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Olivier <[email protected]>
  • Loading branch information
martin-olivier committed Oct 18, 2023
1 parent a111aea commit c6634a8
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
<h1 align="center">
dylib</h1>
dylib</h1>
<p align="center">
<a href="https://github.com/martin-olivier/dylib/releases/tag/v2.1.0">
<img src="https://img.shields.io/badge/Version-2.1.0-blue.svg" alt="version"/>
</a>
<a href="https://github.com/martin-olivier/dylib/releases/tag/v2.2.0">
<img src="https://img.shields.io/badge/Version-2.2.0-blue.svg" alt="version"/></a>
<a href="https://github.com/martin-olivier/dylib/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-orange.svg" alt="license"/>
</a>
<img src="https://img.shields.io/badge/License-MIT-orange.svg" alt="license"/></a>
<a href="https://isocpp.org/">
<img src="https://img.shields.io/badge/Compatibility-C++11-darkgreen.svg" alt="cppversion"/>
</a>
<img src="https://img.shields.io/badge/Compatibility-C++11-darkgreen.svg" alt="cppversion"/></a>
</p>

<p align="center">
<a href="https://github.com/martin-olivier/dylib/actions/workflows/CI.yml">
<img src="https://github.com/martin-olivier/dylib/actions/workflows/CI.yml/badge.svg" alt="ci"/>
</a>
<img src="https://github.com/martin-olivier/dylib/actions/workflows/CI.yml/badge.svg" alt="ci"/></a>
<a href="https://codecov.io/gh/martin-olivier/dylib">
<img src="https://codecov.io/gh/martin-olivier/dylib/branch/main/graph/badge.svg?token=4V6A9B7PII" alt="codecov"/>
</a>
<img src="https://codecov.io/gh/martin-olivier/dylib/branch/main/graph/badge.svg?token=4V6A9B7PII" alt="codecov"/></a>
</p>

The goal of this C++ library is to load dynamic libraries (.so, .dll, .dylib) and access its functions and global variables at runtime.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 9 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -114,6 +120,7 @@ Let's run our code:
```

You will have the following result:

```sh
15
Hello
Expand Down
4 changes: 2 additions & 2 deletions include/dylib.hpp
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @copyright (c) 2022 Martin Olivier
* @copyright (c) 2023 Martin Olivier
*
* This library is released under MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <utility>
#include "dylib.hpp"

TEST(exemple, exemple_test) {
TEST(example, example_test) {
testing::internal::CaptureStdout();
dylib lib("./", "dynamic_lib");

Expand Down

0 comments on commit c6634a8

Please sign in to comment.