-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
66 changed files
with
5,491 additions
and
961 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,36 @@ | ||
##====================================================================================================================== | ||
## SPY - Compact C++20 Tuple Toolbox | ||
## Copyright : SPY Project Contributors | ||
## SPDX-License-Identifier: BSL-1.0 | ||
##====================================================================================================================== | ||
name: SPY Documentation Generation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
generate-doc: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/jfalcou/compilers:v6 | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Fetch current branch | ||
uses: actions/[email protected] | ||
- name: Prepare SPY | ||
run: | | ||
mkdir build && cd build | ||
cmake .. -G Ninja -DSPY_BUILD_TEST=OFF -DSPY_BUILD_DOCUMENTATION=ON | ||
- name: Generate Doxygen | ||
run: | | ||
cd build | ||
ninja spy-doxygen | ||
- name: Deploy to gh-pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build/doc |
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,75 @@ | ||
##====================================================================================================================== | ||
## SPY - Compact C++20 Tuple Toolbox | ||
## Copyright : SPY Project Contributors | ||
## SPDX-License-Identifier: BSL-1.0 | ||
##====================================================================================================================== | ||
name: SPY Integration Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: spy-integration-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
install: | ||
runs-on: [ubuntu-latest] | ||
container: | ||
image: ghcr.io/jfalcou/compilers:v6 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Fetch current branch | ||
uses: actions/[email protected] | ||
- name: Install SPY from checkout | ||
run: | | ||
mkdir build && cd build | ||
cmake -G Ninja .. -DSPY_BUILD_TEST=OFF -DCMAKE_CXX_COMPILER=clang++ | ||
ninja install | ||
- name: Run Sample CMake | ||
run: | | ||
mkdir install && cd install | ||
cmake ../test/integration/install-test -G Ninja | ||
ninja && ctest --verbose | ||
fetch-content: | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
runs-on: [ubuntu-latest] | ||
container: | ||
image: ghcr.io/jfalcou/compilers:v6 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Fetch current branch | ||
uses: actions/[email protected] | ||
- name: Compile using FetchContent | ||
run: | | ||
git config --global --add safe.directory /__w/kumi/kumi | ||
mkdir install && cd install | ||
cmake ../test/integration/fetch-test -G Ninja -DGIT_BRANCH=${BRANCH_NAME} -DSPY_BUILD_TEST=OFF -DCMAKE_CXX_COMPILER=clang++ | ||
ninja && ctest --verbose | ||
cpm: | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
runs-on: [ubuntu-latest] | ||
container: | ||
image: ghcr.io/jfalcou/compilers:v6 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Fetch current branch | ||
uses: actions/[email protected] | ||
- name: Compile using CPM | ||
run: | | ||
git config --global --add safe.directory /__w/kumi/kumi | ||
mkdir install && cd install | ||
cmake ../test/integration/cpm-test -G Ninja -DGIT_BRANCH=${BRANCH_NAME} -DCMAKE_CXX_COMPILER=clang++ -DSPY_BUILD_TEST=OFF | ||
ninja && ctest --verbose |
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
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 |
---|---|---|
@@ -1,65 +1,73 @@ | ||
##================================================================================================== | ||
##====================================================================================================================== | ||
## SPY - C++ Informations Broker | ||
## Copyright : SPY Project Contributors | ||
## SPDX-License-Identifier: BSL-1.0 | ||
##================================================================================================== | ||
cmake_minimum_required(VERSION 3.18) | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## Setup project | ||
## ------------------------------------------------------------------------------------------------- | ||
##====================================================================================================================== | ||
cmake_minimum_required(VERSION 3.22) | ||
project(spy LANGUAGES CXX) | ||
set(PROJECT_VERSION 0.0.2.0) | ||
set(PROJECT_DOC_DIR ${PROJECT_SOURCE_DIR}/doc) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## No in-source build | ||
## ------------------------------------------------------------------------------------------------- | ||
if (${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR}) | ||
message(FATAL_ERROR "[spy]: In-source build is not recommend") | ||
endif() | ||
##====================================================================================================================== | ||
option( SPY_BUILD_TEST "Build tests for SPY" ON ) | ||
option( SPY_BUILD_DOCUMENTATION "Build Doxygen for SPY" OFF ) | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## Options | ||
## ------------------------------------------------------------------------------------------------- | ||
option( SPY_BUILD_TEST "Build tests for spy" ON ) | ||
##====================================================================================================================== | ||
include(${PROJECT_SOURCE_DIR}/cmake/dependencies.cmake) | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## Install target | ||
## ------------------------------------------------------------------------------------------------- | ||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/spy DESTINATION spy ) | ||
install(FILES ${PROJECT_SOURCE_DIR}/include/spy.hpp DESTINATION . ) | ||
if(SPY_BUILD_TEST) | ||
include(${PROJECT_SOURCE_DIR}/cmake/compiler.cmake) | ||
endif() | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## Standalone command | ||
## ------------------------------------------------------------------------------------------------- | ||
find_package(Python COMPONENTS Interpreter) | ||
##====================================================================================================================== | ||
## Project setup via copacabana | ||
##====================================================================================================================== | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ${COPACABANA_SOURCE_DIR}/copacabana/cmake) | ||
include(${COPACABANA_SOURCE_DIR}/copacabana/cmake/copacabana.cmake) | ||
copa_project_version(MAJOR 1 MINOR 1 PATCH 0) | ||
|
||
if(Python_FOUND) | ||
add_custom_command(OUTPUT spy.hpp | ||
COMMAND "${Python_EXECUTABLE}" | ||
${CMAKE_CURRENT_SOURCE_DIR}/script/embed.py | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/spy.hpp | ||
-I include | ||
-o ${CMAKE_CURRENT_SOURCE_DIR}/include/spy.hpp | ||
--include-match spy/* | ||
--guard-match .*_HPP_INCLUDED | ||
|
||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
COMMENT "Generating standalone headers" | ||
VERBATIM | ||
) | ||
##====================================================================================================================== | ||
## Summary Display | ||
##====================================================================================================================== | ||
if(NOT SPY_QUIET) | ||
if(CMAKE_BUILD_TYPE) | ||
message(STATUS "[${PROJECT_NAME}] - Building in ${CMAKE_BUILD_TYPE} mode") | ||
endif() | ||
message(STATUS "[${PROJECT_NAME}] - Unit tests : ${SPY_BUILD_TEST} (via SPY_BUILD_TEST)") | ||
message(STATUS "[${PROJECT_NAME}] - Doxygen : ${SPY_BUILD_DOCUMENTATION} (via SPY_BUILD_DOCUMENTATION)") | ||
set(QUIET_OPTION "") | ||
else() | ||
set(QUIET_OPTION "QUIET") | ||
endif() | ||
|
||
add_custom_target(standalone DEPENDS spy.hpp) | ||
set(SPY_FORCE_STANDALONE 1) | ||
##====================================================================================================================== | ||
## Install Process setup | ||
##====================================================================================================================== | ||
copa_setup_install( LIBRARY spy | ||
FEATURES cxx_std_17 | ||
DOC ${PROJECT_SOURCE_DIR}/LICENSE.md | ||
INCLUDE ${PROJECT_SOURCE_DIR}/include/spy | ||
) | ||
|
||
##====================================================================================================================== | ||
## Setup doxygen | ||
##====================================================================================================================== | ||
if(SPY_BUILD_DOCUMENTATION) | ||
copa_setup_doxygen(${QUIET_OPTION} TARGET spy-doxygen DESTINATION "${PROJECT_BINARY_DIR}/doc") | ||
endif() | ||
|
||
## ------------------------------------------------------------------------------------------------- | ||
## Test target | ||
## ------------------------------------------------------------------------------------------------- | ||
if( SPY_BUILD_TEST ) | ||
include(CTest) | ||
add_subdirectory(${PROJECT_SOURCE_DIR}/test/) | ||
##====================================================================================================================== | ||
## Standalone generation | ||
##====================================================================================================================== | ||
copa_setup_standalone ( QUIET | ||
FILE spy.hpp SOURCE include DESTINATION standalone | ||
ROOT spy TARGET spy-standalone | ||
) | ||
|
||
##====================================================================================================================== | ||
## Tests setup | ||
##====================================================================================================================== | ||
if(SPY_BUILD_TEST) | ||
enable_testing() | ||
add_custom_target(spy-unit) | ||
add_subdirectory(test) | ||
endif() |
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,29 @@ | ||
##====================================================================================================================== | ||
## SPY - C++ Informations Broker | ||
## Copyright : SPY Project Contributors | ||
## SPDX-License-Identifier: BSL-1.0 | ||
##====================================================================================================================== | ||
|
||
##====================================================================================================================== | ||
## Compiler options for Tests | ||
##====================================================================================================================== | ||
add_library(spy_tests INTERFACE) | ||
|
||
target_compile_features ( spy_tests INTERFACE cxx_std_17 ) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") | ||
target_compile_options( spy_tests INTERFACE /W3 /EHsc ) | ||
else() | ||
target_compile_options( spy_tests INTERFACE -Werror -Wall -Wextra -Wunused-variable -Wdocumentation) | ||
endif() | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
target_compile_options( spy_tests INTERFACE /W3 /EHsc /Zc:preprocessor) | ||
else() | ||
target_compile_options( spy_tests INTERFACE -Werror -Wall -Wextra -Wunused-variable) | ||
endif() | ||
|
||
target_include_directories( spy_tests INTERFACE | ||
${PROJECT_SOURCE_DIR}/test | ||
${PROJECT_SOURCE_DIR}/include | ||
) |
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,33 @@ | ||
##====================================================================================================================== | ||
## SPY - C++ Informations Broker | ||
## Copyright : SPY Project Contributors | ||
## SPDX-License-Identifier: BSL-1.0 | ||
##====================================================================================================================== | ||
|
||
##====================================================================================================================== | ||
## Download and setup CPM | ||
##====================================================================================================================== | ||
set(CPM_DOWNLOAD_VERSION 0.34.0) | ||
|
||
if(CPM_SOURCE_CACHE) | ||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
elseif(DEFINED ENV{CPM_SOURCE_CACHE}) | ||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
else() | ||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
endif() | ||
|
||
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) | ||
message(STATUS "[${PROJECT_NAME}] Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") | ||
file(DOWNLOAD | ||
https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
${CPM_DOWNLOAD_LOCATION} | ||
) | ||
endif() | ||
|
||
include(${CPM_DOWNLOAD_LOCATION}) | ||
|
||
##====================================================================================================================== | ||
## Retrieve dependencies | ||
##====================================================================================================================== | ||
CPMAddPackage(NAME COPACABANA GITHUB_REPOSITORY jfalcou/copacabana GIT_TAG main) |
Oops, something went wrong.