-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2735822
Showing
25 changed files
with
3,265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./.format/.clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./.format/.cmake-format.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule ".format"] | ||
path = .format | ||
url = https://github.com/black-desk/.format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
cmake_minimum_required(VERSION 3.11.4) # for RHEL 8 | ||
|
||
# Let's place extra cmake scripts in /cmake directory | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
|
||
# Use this command to update PFL.cmake from GitHub release page: wget -O | ||
# cmake/PFL.cmake | ||
# https://github.com/black-desk/PFL.cmake/releases/latest/download/PFL.cmake | ||
include(PFL) | ||
|
||
set(ENABLE_CPM YES) | ||
if(CMAKE_VERSION VERSION_LESS "3.14") | ||
set(ENABLE_CPM NO) | ||
endif() | ||
|
||
if(CPM_LOCAL_PACKAGES_ONLY) | ||
set(ENABLE_CPM NO) | ||
endif() | ||
|
||
project( | ||
errors | ||
VERSION 0.1.0 | ||
DESCRIPTION "" | ||
HOMEPAGE_URL "https://github.com/black-desk/errors" | ||
LANGUAGES CXX) | ||
|
||
# Use this command to update GitSemver.cmake from GitHub release page: wget -O | ||
# cmake/GitSemver.cmake | ||
# https://github.com/black-desk/GitSemver.cmake/releases/latest/download/GitSemver.cmake | ||
include(GitSemver) | ||
gitsemver(PROJECT_VERSION) | ||
|
||
option(errors_WITH_NLOHMANN_JSON "Build examples and tests with nlohmann_json" | ||
${PROJECT_IS_TOP_LEVEL}) | ||
option(errors_WITH_TL_EXPECTED | ||
"Build examples and tests with TartanLlama/expected" | ||
${PROJECT_IS_TOP_LEVEL}) | ||
|
||
pfl_init() | ||
|
||
macro(cpm_add_dependencies) | ||
if(errors_WITH_NLOHMANN_JSON) | ||
CPMFindPackage( | ||
NAME nlohmann_json | ||
VERSION 3.5.0 | ||
URL "https://github.com/nlohmann/json/archive/refs/tags/v3.5.0.tar.gz" | ||
EXCLUDE_FROM_ALL ON | ||
OPTIONS "JSON_BuildTests OFF") | ||
endif() | ||
|
||
if(errors_WITH_TL_EXPECTED) | ||
CPMFindPackage( | ||
NAME tl-expected | ||
VERSION 1.0.0 | ||
GITHUB_REPOSITORY TartanLlama/expected | ||
GIT_TAG v1.1 | ||
EXCLUDE_FROM_ALL ON) | ||
if(NOT TARGET tl::expected) | ||
add_library(tl::expected ALIAS tl-expected) | ||
endif() | ||
endif() | ||
|
||
if(errors_ENABLE_TESTING) | ||
CPMAddPackage( | ||
NAME Catch2 | ||
GITHUB_REPOSITORY catchorg/Catch2 | ||
GIT_TAG v3.4.0 | ||
VERSION 3.4.0) | ||
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras) | ||
message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}") | ||
endif() | ||
endmacro() | ||
|
||
# Use this command to update CPM.cmake from GitHub release page: wget -O | ||
# cmake/CPM.cmake | ||
# https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake | ||
if(NOT ENABLE_CPM) | ||
message(STATUS "CPM.cmake disabled.") | ||
else() | ||
include(CPM) | ||
cpm_add_dependencies() | ||
endif() | ||
|
||
pfl_add_library( | ||
LIBRARY_TYPE | ||
HEADER_ONLY | ||
SOURCES | ||
# find -regex '\./\(src\|include\)/.+\.[ch]\(pp\)?\(\.in\)?' -type f | sort | ||
./include/errors/config.hpp.in | ||
./include/errors/error.hpp | ||
./include/errors/source_location.hpp | ||
./include/errors/version.hpp | ||
./src/errors/config.cpp | ||
./src/errors/error.cpp | ||
./src/errors/version.cpp | ||
EXAMPLES | ||
print-messages | ||
use-with-expected | ||
TESTS | ||
errors-unit-tests | ||
COMPILE_FEATURES | ||
INTERFACE | ||
cxx_std_17) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# A header only golang-like error warping library for c++17 |
Oops, something went wrong.