Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none

Checks: >
cert-*,
performance-*,
modernize-*,
misc-include-cleaner,
-readability-identifier-length,
-readability-magic-numbers,
-cppcoreguidelines-avoid-magic-numbers
CheckOptions:
- key: readability-identifier-length.IgnoredVariableNames
value: 'x|y|z'
- key: readability-identifier-length.IgnoredParameterNames
value: 'x|y|z'





- key: misc-include-cleaner.IgnoreHeaders
value: >
boost/test/.*;
__chrono/.*
HeaderFilterRegex: '^.*/include/chains/.*$'
57 changes: 33 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ add_library(chains::chains_warnings ALIAS chains_warnings)
#add_library(chains::chains_options INTERFACE IMPORTED)
#add_library(chains::chains_warnings INTERFACE IMPORTED)


add_library(chains INTERFACE)
add_library(chains::chains ALIAS stlab)

target_include_directories(stlab INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>/include
$<INSTALL_INTERFACE:include>)

# configure files based on CMake configuration options
add_subdirectory(configured_files)

Expand All @@ -74,14 +83,14 @@ if(BUILD_TESTING)
endif()


if(chains_BUILD_FUZZ_TESTS)
message(AUTHOR_WARNING "Building Fuzz Tests, using fuzzing sanitizer https://www.llvm.org/docs/LibFuzzer.html")
if (NOT chains_ENABLE_ADDRESS_SANITIZER AND NOT chains_ENABLE_THREAD_SANITIZER)
message(WARNING "You need asan or tsan enabled for meaningful fuzz testing")
endif()
add_subdirectory(fuzz_test)
# if(chains_BUILD_FUZZ_TESTS)
# message(AUTHOR_WARNING "Building Fuzz Tests, using fuzzing sanitizer https://www.llvm.org/docs/LibFuzzer.html")
# if (NOT chains_ENABLE_ADDRESS_SANITIZER AND NOT chains_ENABLE_THREAD_SANITIZER)
# message(WARNING "You need asan or tsan enabled for meaningful fuzz testing")
# endif()
# add_subdirectory(fuzz_test)

endif()
# endif()

# If MSVC is being used, and ASAN is enabled, we need to set the debugger environment
# so that it behaves well with MSVC's debugger, and we can run the target from visual studio
Expand All @@ -92,30 +101,30 @@ if(MSVC)
endif()

# set the startup project for the "play" button in MSVC
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT intro)
# set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT intro)

if(CMAKE_SKIP_INSTALL_RULES)
return()
endif()
# if(CMAKE_SKIP_INSTALL_RULES)
# return()
# endif()

include(cmake/PackageProject.cmake)
# include(cmake/PackageProject.cmake)

# Add other targets that you want installed here, by default we just package the one executable
# we know we want to ship
chains_package_project(
TARGETS
intro
chains_options
chains_warnings
# FIXME: this does not work! CK
# PRIVATE_DEPENDENCIES_CONFIGURED project_options project_warnings
)
# chains_package_project(
# TARGETS
# intro
# chains_options
# chains_warnings
# # FIXME: this does not work! CK
# # PRIVATE_DEPENDENCIES_CONFIGURED project_options project_warnings
# )

# Experience shows that explicit package naming can help make it easier to sort
# out potential ABI related issues before they start, while helping you
# track a build to a specific GIT SHA
set(CPACK_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${GIT_SHORT_SHA}-${CMAKE_SYSTEM_NAME}-${CMAKE_BUILD_TYPE}-${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
)
# set(CPACK_PACKAGE_FILE_NAME
# "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${GIT_SHORT_SHA}-${CMAKE_SYSTEM_NAME}-${CMAKE_BUILD_TYPE}-${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
# )

include(CPack)
# include(CPack)
44 changes: 22 additions & 22 deletions Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@ function(chains_setup_dependencies)
if(NOT TARGET stlab::stlab)
cpmaddpackage(
NAME stlab
VERSION 2.0.0a3
VERSION 2.0.0a9
GITHUB_REPOSITORY "stlab/libraries"
OPTIONS "BUILD_TESTING OFF")
endif()

if(NOT TARGET fmtlib::fmtlib)
cpmaddpackage("gh:fmtlib/fmt#9.1.0")
endif()

if(NOT TARGET spdlog::spdlog)
cpmaddpackage(
NAME
spdlog
VERSION
1.11.0
GITHUB_REPOSITORY
"gabime/spdlog"
OPTIONS
"SPDLOG_FMT_EXTERNAL ON")
endif()
# if(NOT TARGET fmtlib::fmtlib)
# cpmaddpackage("gh:fmtlib/fmt#9.1.0")
# endif()

# if(NOT TARGET spdlog::spdlog)
# cpmaddpackage(
# NAME
# spdlog
# VERSION
# 1.11.0
# GITHUB_REPOSITORY
# "gabime/spdlog"
# OPTIONS
# "SPDLOG_FMT_EXTERNAL ON")
# endif()

if(NOT TARGET Catch2::Catch2WithMain)
cpmaddpackage("gh:catchorg/Catch2@3.3.2")
endif()

if(NOT TARGET CLI11::CLI11)
cpmaddpackage("gh:CLIUtils/CLI11@2.3.2")
endif()
# if(NOT TARGET CLI11::CLI11)
# cpmaddpackage("gh:CLIUtils/CLI11@2.3.2")
# endif()

if(NOT TARGET ftxui::screen)
cpmaddpackage("gh:ArthurSonzogni/FTXUI#e23dbc7473654024852ede60e2121276c5aab660")
endif()
# if(NOT TARGET ftxui::screen)
# cpmaddpackage("gh:ArthurSonzogni/FTXUI#e23dbc7473654024852ede60e2121276c5aab660")
# endif()

if(NOT TARGET tools::tools)
cpmaddpackage("gh:lefticus/tools#update_build_system")
Expand Down
16 changes: 8 additions & 8 deletions ProjectOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include(cmake/SystemLink.cmake)
include(cmake/LibFuzzer.cmake)
# include(cmake/LibFuzzer.cmake)
include(CMakeDependentOption)
include(CheckCXXCompilerFlag)

Expand Down Expand Up @@ -78,14 +78,14 @@ macro(chains_setup_options)
chains_ENABLE_CACHE)
endif()

chains_check_libfuzzer_support(LIBFUZZER_SUPPORTED)
if(LIBFUZZER_SUPPORTED AND (chains_ENABLE_SANITIZER_ADDRESS OR chains_ENABLE_SANITIZER_THREAD OR chains_ENABLE_SANITIZER_UNDEFINED))
set(DEFAULT_FUZZER ON)
else()
set(DEFAULT_FUZZER OFF)
endif()
# chains_check_libfuzzer_support(LIBFUZZER_SUPPORTED)
# if(LIBFUZZER_SUPPORTED AND (chains_ENABLE_SANITIZER_ADDRESS OR chains_ENABLE_SANITIZER_THREAD OR chains_ENABLE_SANITIZER_UNDEFINED))
# set(DEFAULT_FUZZER ON)
# else()
# set(DEFAULT_FUZZER OFF)
# endif()

option(chains_BUILD_FUZZ_TESTS "Enable fuzz testing executable" ${DEFAULT_FUZZER})
# option(chains_BUILD_FUZZ_TESTS "Enable fuzz testing executable" ${DEFAULT_FUZZER})

endmacro()

Expand Down
2 changes: 1 addition & 1 deletion cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function(
set(CLANG_WARNINGS
-Wall
-Wextra # reasonable and standard
-Wshadow # warn the user if a variable declaration shadows one from a parent context
#-Wshadow # warn the user if a variable declaration shadows one from a parent context
-Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps
# catch hard to track down memory errors
-Wold-style-cast # warn for c-style casts
Expand Down
17 changes: 0 additions & 17 deletions cmake/LibFuzzer.cmake

This file was deleted.

4 changes: 4 additions & 0 deletions cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ else()
message(STATUS "No colored compiler diagnostic set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
endif()

# Enable __cplusplus makro on MSVC which is disabled by default
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>)
endif()

# run vcvarsall when msvc is used
include("${CMAKE_CURRENT_LIST_DIR}/VCEnvironment.cmake")
Expand Down
21 changes: 0 additions & 21 deletions fuzz_test/CMakeLists.txt

This file was deleted.

20 changes: 0 additions & 20 deletions fuzz_test/fuzz_tester.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions include/chains/sample_library.hpp

This file was deleted.

Loading
Loading