Skip to content

Commit

Permalink
-updated seal_lake to v0.2.0;
Browse files Browse the repository at this point in the history
-updated all figcone dependencies versions;
-added CMakePresets.json;
-set version to 3.1.0;
  • Loading branch information
kamchatka-volcano committed May 25, 2024
1 parent d594d4f commit ba13fa1
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 49 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,34 @@ jobs:
- {
name: "Ubuntu Latest gcc",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
cmake-preset: gcc-release,
artifacts-path: ""
}
- {
name: "Ubuntu Latest clang",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
cmake-preset: clang-release,
artifacts-path: ""
}
- {
name: "Windows Latest MSVC",
os: windows-latest,
cc: "cl",
cxx: "cl",
flags: "/EHsc /W4 /WX /wd4267",
cmake-preset: msvc-release,
artifacts-path: "/Release"
}

steps:
- uses: actions/checkout@v3
- name: Install ninja (Windows)
if: matrix.config.os == 'windows-latest'
run: choco install ninja
- name: Install ninja (Linux)
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt install ninja-build
- uses: actions/checkout@v4

- uses: rui314/setup-mold@v1
- uses: hendrikmuhs/ccache-action@v1.2
- uses: ilammy/msvc-dev-cmd@v1

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON -DENABLE_TESTS_CPP20=ON -DENABLE_TESTS_STATIC_REFL=ON -DENABLE_EXAMPLES=ON -DENABLE_EXAMPLES_STATIC_REFL=ON -DFIGCONE_USE_NAMEOF=${{ matrix.use_nameof }} -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }}"
Expand Down
25 changes: 12 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
cmake_minimum_required(VERSION 3.18)
project(figcone VERSION 3.0.0)
include(GNUInstallDirs)
project(figcone VERSION 3.1.0)
include(external/seal_lake)

SealLake_IsInstalled(INSTALL_FIGCONE_TREE)
SealLake_IsInstallEnabled(INSTALL_FIGCONE_TREE)
SealLake_Import(
figcone_tree 2.0.0
figcone_tree 2.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_tree.git
GIT_TAG v2.0.0
GIT_TAG v2.1.0
)

option(FIGCONE_USE_NAMEOF "Enable automatic registration of struct field names using the nameof library" ON)
if (FIGCONE_USE_NAMEOF)
SealLake_IsInstalled(NAMEOF_OPT_INSTALL)
SealLake_IsInstallEnabled(NAMEOF_OPT_INSTALL)
SealLake_Bundle(
NAME figcone_nameof
SKIP_LOAD
Expand Down Expand Up @@ -72,15 +71,15 @@ SealLake_Bundle(
SealLake_Bundle(
NAME figcone_sfun
GIT_REPOSITORY https://github.com/kamchatka-volcano/sfun.git
GIT_TAG dev
GIT_TAG v5.1.0
DESTINATION include/figcone/detail/external
DIRECTORIES include/sfun
TEXT_REPLACEMENTS
"namespace sfun" "namespace figcone::sfun"
"SFUN_" "FIGCONE_SFUN_"
)

SealLake_IsInstalled(INSTALL_FIGCONE_FORMATS)
SealLake_IsInstallEnabled(INSTALL_FIGCONE_FORMATS)
add_subdirectory(formats)

if (FIGCONE_USE_NAMEOF AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
Expand All @@ -94,19 +93,19 @@ SealLake_HeaderOnlyLibrary(
LIBRARIES
figcone::figcone_tree
DEPENDENCIES
figcone_tree 2.0.0
figcone_tree 2.1.0
)

if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON OR FIGCONE_USE_YAML OR FIGCONE_USE_TOML OR FIGCONE_USE_INI OR FIGCONE_USE_XML OR FIGCONE_USE_SHOAL)
SealLake_Libraries(
SealLake_AddLibraries(
figcone::figcone_formats
)
SealLake_Dependencies(
figcone_formats 1.0.0
SealLake_AddDependencies(
figcone_formats 1.1.0
)
endif ()

SealLake_OptionalBuildSteps(
SealLake_OptionalSubProjects(
tests
tests_cpp20
tests_static_refl
Expand Down
123 changes: 123 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"version": 6,
"configurePresets": [
{
"name": "base-linux",
"hidden": true,
"displayName": "linux base preset",
"generator": "Ninja",
"binaryDir": "build-${presetName}",
"cacheVariables": {
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=mold",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CPM_SOURCE_CACHE": "cpm_cache"
}
},
{
"name": "clang-base",
"hidden": true,
"displayName": "clang base preset",
"inherits": "base-linux",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Werror -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
}
},
{
"name": "clang-debug",
"displayName": "clang (Debug)",
"inherits": "clang-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "clang-release",
"displayName": "clang (Release)",
"inherits": "clang-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "gcc-base",
"hidden": true,
"displayName": "gcc base preset",
"inherits": "base-linux",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Werror -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
}
},
{
"name": "gcc-debug",
"displayName": "gcc (Debug)",
"inherits": "gcc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "gcc-release",
"displayName": "gcc (Release)",
"inherits": "gcc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "base-windows",
"displayName": "windows base preset",
"hidden": true,
"generator": "Ninja",
"binaryDir": "build-${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CPM_SOURCE_CACHE": "cpm_cache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
},
"jetbrains.com/clion": {
"toolchain": "Visual Studio"
}
}
},
{
"name": "msvc-base",
"hidden": true,
"displayName": "msvc base preset",
"inherits": "base-windows",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "cl.exe",
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_FLAGS": "/EHsc /W4 /WX /wd4267"
}
},
{
"name": "msvc-debug",
"displayName": "msvc (Debug)",
"inherits": "msvc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "msvc-release",
"displayName": "msvc (Release)",
"inherits": "msvc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
]
}
14 changes: 8 additions & 6 deletions external/seal_lake
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
include(FetchContent)
Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(seal_lake
GIT_REPOSITORY https://github.com/kamchatka-volcano/seal_lake.git
GIT_TAG master
set(SEAL_LAKE_VERSION v0.2.0)
set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(seal_lake_${SEAL_LAKE_VERSION}
SOURCE_DIR seal_lake_${SEAL_LAKE_VERSION}
GIT_REPOSITORY "https://github.com/kamchatka-volcano/seal_lake.git"
GIT_TAG ${SEAL_LAKE_VERSION}
)
FetchContent_MakeAvailable(seal_lake)
include(${seal_lake_SOURCE_DIR}/seal_lake.cmake)
FetchContent_MakeAvailable(seal_lake_${SEAL_LAKE_VERSION})
include(${seal_lake_${SEAL_LAKE_VERSION}_SOURCE_DIR}/seal_lake.cmake)
40 changes: 20 additions & 20 deletions formats/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(figcone_formats VERSION 1.0.0)
project(figcone_formats VERSION 1.1.0)

option(FIGCONE_USE_ALL "Enable all supported config formats" ON)
option(FIGCONE_USE_JSON "Enable JSON config format" OFF)
Expand All @@ -15,9 +15,9 @@ file(REMOVE_RECURSE ${figcone_SOURCE_DIR}/include/figcone/format)

if(FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
SealLake_Import(
figcone_json 1.0.0
figcone_json 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_json.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_json_SOURCE_DIR}/include/figcone_json/*
Expand All @@ -27,9 +27,9 @@ endif()

if(FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
SealLake_Import(
figcone_yaml 1.0.0
figcone_yaml 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_yaml.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_yaml_SOURCE_DIR}/include/figcone_yaml/*
Expand All @@ -39,9 +39,9 @@ endif()

if(FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
SealLake_Import(
figcone_toml 1.0.0
figcone_toml 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_toml.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_toml_SOURCE_DIR}/include/figcone_toml/*
Expand All @@ -51,9 +51,9 @@ endif()

if(FIGCONE_USE_ALL OR FIGCONE_USE_INI)
SealLake_Import(
figcone_ini 1.0.0
figcone_ini 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_ini.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_ini_SOURCE_DIR}/include/figcone_ini/*
Expand All @@ -64,9 +64,9 @@ endif()

if(FIGCONE_USE_ALL OR FIGCONE_USE_XML)
SealLake_Import(
figcone_xml 1.0.0
figcone_xml 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_xml.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_xml_SOURCE_DIR}/include/figcone_xml/*
Expand All @@ -76,9 +76,9 @@ endif()

if(FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
SealLake_Import(
figcone_shoal 1.0.0
figcone_shoal 1.1.0
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_shoal.git
GIT_TAG v1.0.0
GIT_TAG v1.1.0
)
SealLake_Copy(
WILDCARDS ${figcone_shoal_SOURCE_DIR}/include/figcone_shoal/*
Expand All @@ -94,25 +94,25 @@ SealLake_StaticLibrary(
INTERFACE_LIBRARIES
figcone::figcone_tree
DEPENDENCIES
figcone_tree 2.0.0
figcone_tree 2.1.0
)
endif()

if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
SealLake_Libraries(figcone::figcone_json)
SealLake_AddLibraries(figcone::figcone_json)
endif()
if (FIGCONE_USE_ALL OR FIGCONE_USE_INI)
SealLake_Libraries(figcone::figcone_ini)
SealLake_AddLibraries(figcone::figcone_ini)
endif()
if (FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
SealLake_Libraries(figcone::figcone_shoal)
SealLake_AddLibraries(figcone::figcone_shoal)
endif()
if (FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
SealLake_Libraries(figcone::figcone_toml)
SealLake_AddLibraries(figcone::figcone_toml)
endif()
if (FIGCONE_USE_ALL OR FIGCONE_USE_XML)
SealLake_Libraries(figcone::figcone_xml)
SealLake_AddLibraries(figcone::figcone_xml)
endif()
if (FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
SealLake_Libraries(figcone::figcone_yaml)
SealLake_AddLibraries(figcone::figcone_yaml)
endif()

0 comments on commit ba13fa1

Please sign in to comment.