Skip to content

Commit

Permalink
chore: add leaf third party library
Browse files Browse the repository at this point in the history
Add leaf third party library to replace outcome.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
  • Loading branch information
melg8 committed Jan 19, 2023
1 parent 7f3931a commit 298b76e
Show file tree
Hide file tree
Showing 10 changed files with 5,231 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false # Enable only if runner has internet connection.
PRINT_ALPACA: false # Don't print logo.

FILTER_REGEX_EXCLUDE: ".*/third_party/.*.hpp"

# GIT_DIFF
GIT_GIT_DIFF_ARGUMENTS: HEAD^

Expand Down Expand Up @@ -78,6 +80,7 @@ NIX_NIX_LINTER_FILTER_REGEX_EXCLUDE: "node-env.nix|node-packages.nix"
SPELL_CODESPELL_ARGUMENTS: >
-D=-
-D=ci/checks/dictionaries/spelling_corrections.txt
--skip="sources/example_glassy/third_party/sources"
# CMAKE_FORMAT
CMAKE_CMAKE_FORMAT_DISABLE_ERRORS: true
Expand Down
7 changes: 7 additions & 0 deletions LICENSES/BSL-1.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions ci/checks/code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cpplint \
--recursive \
--linelength=80 \
--includeorder=standardcfirst \
--exclude="./sources/example_glassy/third_party" \
--filter=-build/c++11,-build/header_guard,-runtime/references,-readability/check,-readability/nolint \
--root=./sources \
./sources
Expand Down
1 change: 1 addition & 0 deletions ci/checks/dictionaries/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dictionaries": ["cpp", "bash", "python", "ruby", "workspace", "nix", "names"],
"ignorePaths": ["ci/checks/dictionaries/spelling_corrections.txt",
"LICENSES/*",
"sources/example_glassy/third_party/sources/*",
"*deps.nix",
"*gemset.nix",
"*Gemfile.lock",
Expand Down
1 change: 1 addition & 0 deletions ci/checks/spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -e
DICTIONARY="./ci/checks/dictionaries/spelling_corrections.txt"
SKIP=".git,\
./ci/checks/dictionaries/*,\
./sources/example_glassy/third_party/sources/*,\
*package-lock.json,\
*CMakeLists.txt.user,\
*node-packages.nix"
Expand Down
1 change: 1 addition & 0 deletions sources/example_glassy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

add_subdirectory(application)
add_subdirectory(library)
add_subdirectory(third_party)

if(ENABLE_TESTING)
add_subdirectory(tests)
Expand Down
4 changes: 2 additions & 2 deletions sources/example_glassy/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ header_directories(ALL_LIB_INCLUDE_DIRECTORIES)
target_include_directories(glassy PUBLIC "${ALL_LIB_INCLUDE_DIRECTORIES}"
"${OUTCOME_INCLUDE_DIR}")

target_link_libraries(glassy PUBLIC OpenSSL::Crypto outcome::outcome
gsl::gsl-lite)
target_link_libraries(glassy PUBLIC third_party OpenSSL::Crypto
outcome::outcome gsl::gsl-lite)
1 change: 1 addition & 0 deletions sources/example_glassy/library/sources/asn_1_integer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <openssl/asn1.h>
#include <gsl/gsl-lite.hpp>
#include <leaf.hpp>
#include <outcome.hpp>

namespace glassy {
Expand Down
16 changes: 16 additions & 0 deletions sources/example_glassy/third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: © 2022 Melg Eight <public.melg8@gmail.com>
#
# SPDX-License-Identifier: MIT

file(GLOB_RECURSE ALL_THIRD_PARTY_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
file(GLOB_RECURSE ALL_THIRD_PARTY_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")

add_library(third_party INTERFACE "${ALL_THIRD_PARTY_HEADERS}"
"${ALL_THIRD_PARTY_SOURCES}")

header_directories(ALL_LIB_INCLUDE_DIRECTORIES)

target_include_directories(third_party SYSTEM
INTERFACE "${ALL_LIB_INCLUDE_DIRECTORIES}")

target_link_libraries(third_party)
Loading

0 comments on commit 298b76e

Please sign in to comment.