Skip to content

Commit 8a668e8

Browse files
-updated seal_lake to v0.2.0;
-updated all figcone dependencies versions; -added CMakePresets.json; -made config.h self-sufficient by adding configreader.h include; -fixed compiler warnings; -set version to 3.1.0;
1 parent d594d4f commit 8a668e8

File tree

9 files changed

+182
-53
lines changed

9 files changed

+182
-53
lines changed

.github/workflows/build_and_test.yml

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: build & test (clang, gcc, MSVC)
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ "master", "dev", "v3" ]
67
paths-ignore:
@@ -26,30 +27,34 @@ jobs:
2627
- {
2728
name: "Ubuntu Latest gcc",
2829
os: ubuntu-latest,
29-
cc: "gcc",
30-
cxx: "g++",
31-
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
30+
cmake-preset: gcc-release,
3231
artifacts-path: ""
3332
}
3433
- {
3534
name: "Ubuntu Latest clang",
3635
os: ubuntu-latest,
37-
cc: "clang",
38-
cxx: "clang++",
39-
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
36+
cmake-preset: clang-release,
4037
artifacts-path: ""
4138
}
4239
- {
4340
name: "Windows Latest MSVC",
4441
os: windows-latest,
45-
cc: "cl",
46-
cxx: "cl",
47-
flags: "/EHsc /W4 /WX /wd4267",
42+
cmake-preset: msvc-release,
4843
artifacts-path: "/Release"
4944
}
5045

5146
steps:
52-
- uses: actions/checkout@v3
47+
- name: Install ninja (Windows)
48+
if: matrix.config.os == 'windows-latest'
49+
run: choco install ninja
50+
- name: Install ninja (Linux)
51+
if: matrix.config.os == 'ubuntu-latest'
52+
run: sudo apt install ninja-build
53+
- uses: actions/checkout@v4
54+
55+
- uses: rui314/setup-mold@v1
56+
- uses: hendrikmuhs/[email protected]
57+
- uses: ilammy/msvc-dev-cmd@v1
5358

5459
- name: Configure CMake
5560
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 }}"

CMakeLists.txt

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
cmake_minimum_required(VERSION 3.18)
2-
project(figcone VERSION 3.0.0)
3-
include(GNUInstallDirs)
2+
project(figcone VERSION 3.1.0)
43
include(external/seal_lake)
54

6-
SealLake_IsInstalled(INSTALL_FIGCONE_TREE)
5+
SealLake_IsInstallEnabled(INSTALL_FIGCONE_TREE)
76
SealLake_Import(
8-
figcone_tree 2.0.0
7+
figcone_tree 2.1.0
98
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_tree.git
10-
GIT_TAG v2.0.0
9+
GIT_TAG v2.1.0
1110
)
1211

1312
option(FIGCONE_USE_NAMEOF "Enable automatic registration of struct field names using the nameof library" ON)
1413
if (FIGCONE_USE_NAMEOF)
15-
SealLake_IsInstalled(NAMEOF_OPT_INSTALL)
14+
SealLake_IsInstallEnabled(NAMEOF_OPT_INSTALL)
1615
SealLake_Bundle(
1716
NAME figcone_nameof
1817
SKIP_LOAD
1918
GIT_REPOSITORY https://github.com/Neargye/nameof.git
20-
GIT_TAG master
19+
GIT_TAG v0.10.4
2120
DESTINATION include/figcone/detail/external
2221
FILES include/nameof.hpp
2322
TEXT_REPLACEMENTS
@@ -72,15 +71,15 @@ SealLake_Bundle(
7271
SealLake_Bundle(
7372
NAME figcone_sfun
7473
GIT_REPOSITORY https://github.com/kamchatka-volcano/sfun.git
75-
GIT_TAG dev
74+
GIT_TAG v5.1.0
7675
DESTINATION include/figcone/detail/external
7776
DIRECTORIES include/sfun
7877
TEXT_REPLACEMENTS
7978
"namespace sfun" "namespace figcone::sfun"
8079
"SFUN_" "FIGCONE_SFUN_"
8180
)
8281

83-
SealLake_IsInstalled(INSTALL_FIGCONE_FORMATS)
82+
SealLake_IsInstallEnabled(INSTALL_FIGCONE_FORMATS)
8483
add_subdirectory(formats)
8584

8685
if (FIGCONE_USE_NAMEOF AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@@ -94,19 +93,19 @@ SealLake_HeaderOnlyLibrary(
9493
LIBRARIES
9594
figcone::figcone_tree
9695
DEPENDENCIES
97-
figcone_tree 2.0.0
96+
figcone_tree 2.1.0
9897
)
9998

10099
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)
101-
SealLake_Libraries(
100+
SealLake_AddLibraries(
102101
figcone::figcone_formats
103102
)
104-
SealLake_Dependencies(
105-
figcone_formats 1.0.0
103+
SealLake_AddDependencies(
104+
figcone_formats 1.1.0
106105
)
107106
endif ()
108107

109-
SealLake_OptionalBuildSteps(
108+
SealLake_OptionalSubProjects(
110109
tests
111110
tests_cpp20
112111
tests_static_refl

CMakePresets.json

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"version": 6,
3+
"configurePresets": [
4+
{
5+
"name": "base-linux",
6+
"hidden": true,
7+
"displayName": "linux base preset",
8+
"generator": "Ninja",
9+
"binaryDir": "build-${presetName}",
10+
"cacheVariables": {
11+
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=mold",
12+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
13+
"CPM_SOURCE_CACHE": "cpm_cache"
14+
}
15+
},
16+
{
17+
"name": "clang-base",
18+
"hidden": true,
19+
"displayName": "clang base preset",
20+
"inherits": "base-linux",
21+
"cacheVariables": {
22+
"CMAKE_CXX_COMPILER": "clang++",
23+
"CMAKE_C_COMPILER": "clang",
24+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Werror -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
25+
}
26+
},
27+
{
28+
"name": "clang-debug",
29+
"displayName": "clang (Debug)",
30+
"inherits": "clang-base",
31+
"cacheVariables": {
32+
"CMAKE_BUILD_TYPE": "Debug"
33+
}
34+
},
35+
{
36+
"name": "clang-release",
37+
"displayName": "clang (Release)",
38+
"inherits": "clang-base",
39+
"cacheVariables": {
40+
"CMAKE_BUILD_TYPE": "Release"
41+
}
42+
},
43+
{
44+
"name": "gcc-base",
45+
"hidden": true,
46+
"displayName": "gcc base preset",
47+
"inherits": "base-linux",
48+
"cacheVariables": {
49+
"CMAKE_CXX_COMPILER": "g++",
50+
"CMAKE_C_COMPILER": "gcc",
51+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Werror -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
52+
}
53+
},
54+
{
55+
"name": "gcc-debug",
56+
"displayName": "gcc (Debug)",
57+
"inherits": "gcc-base",
58+
"cacheVariables": {
59+
"CMAKE_BUILD_TYPE": "Debug"
60+
}
61+
},
62+
{
63+
"name": "gcc-release",
64+
"displayName": "gcc (Release)",
65+
"inherits": "gcc-base",
66+
"cacheVariables": {
67+
"CMAKE_BUILD_TYPE": "Release"
68+
}
69+
},
70+
{
71+
"name": "base-windows",
72+
"displayName": "windows base preset",
73+
"hidden": true,
74+
"generator": "Ninja",
75+
"binaryDir": "build-${presetName}",
76+
"architecture": {
77+
"value": "x64",
78+
"strategy": "external"
79+
},
80+
"cacheVariables": {
81+
"CPM_SOURCE_CACHE": "cpm_cache",
82+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
83+
},
84+
"vendor": {
85+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
86+
"hostOS": [
87+
"Windows"
88+
]
89+
},
90+
"jetbrains.com/clion": {
91+
"toolchain": "Visual Studio"
92+
}
93+
}
94+
},
95+
{
96+
"name": "msvc-base",
97+
"hidden": true,
98+
"displayName": "msvc base preset",
99+
"inherits": "base-windows",
100+
"cacheVariables": {
101+
"CMAKE_CXX_COMPILER": "cl.exe",
102+
"CMAKE_C_COMPILER": "cl.exe",
103+
"CMAKE_CXX_FLAGS": "/EHsc /W4 /WX /wd4267"
104+
}
105+
},
106+
{
107+
"name": "msvc-debug",
108+
"displayName": "msvc (Debug)",
109+
"inherits": "msvc-base",
110+
"cacheVariables": {
111+
"CMAKE_BUILD_TYPE": "Debug"
112+
}
113+
},
114+
{
115+
"name": "msvc-release",
116+
"displayName": "msvc (Release)",
117+
"inherits": "msvc-base",
118+
"cacheVariables": {
119+
"CMAKE_BUILD_TYPE": "Release"
120+
}
121+
}
122+
]
123+
}

external/seal_lake

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
include(FetchContent)
2-
Set(FETCHCONTENT_QUIET FALSE)
3-
FetchContent_Declare(seal_lake
4-
GIT_REPOSITORY https://github.com/kamchatka-volcano/seal_lake.git
5-
GIT_TAG master
2+
set(SEAL_LAKE_VERSION v0.2.0)
3+
set(FETCHCONTENT_QUIET FALSE)
4+
FetchContent_Declare(seal_lake_${SEAL_LAKE_VERSION}
5+
SOURCE_DIR seal_lake_${SEAL_LAKE_VERSION}
6+
GIT_REPOSITORY "https://github.com/kamchatka-volcano/seal_lake.git"
7+
GIT_TAG ${SEAL_LAKE_VERSION}
68
)
7-
FetchContent_MakeAvailable(seal_lake)
8-
include(${seal_lake_SOURCE_DIR}/seal_lake.cmake)
9+
FetchContent_MakeAvailable(seal_lake_${SEAL_LAKE_VERSION})
10+
include(${seal_lake_${SEAL_LAKE_VERSION}_SOURCE_DIR}/seal_lake.cmake)

formats/CMakeLists.txt

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project(figcone_formats VERSION 1.0.0)
1+
project(figcone_formats VERSION 1.1.0)
22

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

1616
if(FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
1717
SealLake_Import(
18-
figcone_json 1.0.0
18+
figcone_json 1.1.0
1919
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_json.git
20-
GIT_TAG v1.0.0
20+
GIT_TAG v1.1.0
2121
)
2222
SealLake_Copy(
2323
WILDCARDS ${figcone_json_SOURCE_DIR}/include/figcone_json/*
@@ -27,9 +27,9 @@ endif()
2727

2828
if(FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
2929
SealLake_Import(
30-
figcone_yaml 1.0.0
30+
figcone_yaml 1.1.0
3131
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_yaml.git
32-
GIT_TAG v1.0.0
32+
GIT_TAG v1.1.0
3333
)
3434
SealLake_Copy(
3535
WILDCARDS ${figcone_yaml_SOURCE_DIR}/include/figcone_yaml/*
@@ -39,9 +39,9 @@ endif()
3939

4040
if(FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
4141
SealLake_Import(
42-
figcone_toml 1.0.0
42+
figcone_toml 1.1.0
4343
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_toml.git
44-
GIT_TAG v1.0.0
44+
GIT_TAG v1.1.0
4545
)
4646
SealLake_Copy(
4747
WILDCARDS ${figcone_toml_SOURCE_DIR}/include/figcone_toml/*
@@ -51,9 +51,9 @@ endif()
5151

5252
if(FIGCONE_USE_ALL OR FIGCONE_USE_INI)
5353
SealLake_Import(
54-
figcone_ini 1.0.0
54+
figcone_ini 1.1.0
5555
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_ini.git
56-
GIT_TAG v1.0.0
56+
GIT_TAG v1.1.0
5757
)
5858
SealLake_Copy(
5959
WILDCARDS ${figcone_ini_SOURCE_DIR}/include/figcone_ini/*
@@ -64,9 +64,9 @@ endif()
6464

6565
if(FIGCONE_USE_ALL OR FIGCONE_USE_XML)
6666
SealLake_Import(
67-
figcone_xml 1.0.0
67+
figcone_xml 1.1.0
6868
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_xml.git
69-
GIT_TAG v1.0.0
69+
GIT_TAG v1.1.0
7070
)
7171
SealLake_Copy(
7272
WILDCARDS ${figcone_xml_SOURCE_DIR}/include/figcone_xml/*
@@ -76,9 +76,9 @@ endif()
7676

7777
if(FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
7878
SealLake_Import(
79-
figcone_shoal 1.0.0
79+
figcone_shoal 1.1.0
8080
GIT_REPOSITORY https://github.com/kamchatka-volcano/figcone_shoal.git
81-
GIT_TAG v1.0.0
81+
GIT_TAG v1.1.0
8282
)
8383
SealLake_Copy(
8484
WILDCARDS ${figcone_shoal_SOURCE_DIR}/include/figcone_shoal/*
@@ -94,25 +94,25 @@ SealLake_StaticLibrary(
9494
INTERFACE_LIBRARIES
9595
figcone::figcone_tree
9696
DEPENDENCIES
97-
figcone_tree 2.0.0
97+
figcone_tree 2.1.0
9898
)
9999
endif()
100100

101101
if (FIGCONE_USE_ALL OR FIGCONE_USE_JSON)
102-
SealLake_Libraries(figcone::figcone_json)
102+
SealLake_AddLibraries(figcone::figcone_json)
103103
endif()
104104
if (FIGCONE_USE_ALL OR FIGCONE_USE_INI)
105-
SealLake_Libraries(figcone::figcone_ini)
105+
SealLake_AddLibraries(figcone::figcone_ini)
106106
endif()
107107
if (FIGCONE_USE_ALL OR FIGCONE_USE_SHOAL)
108-
SealLake_Libraries(figcone::figcone_shoal)
108+
SealLake_AddLibraries(figcone::figcone_shoal)
109109
endif()
110110
if (FIGCONE_USE_ALL OR FIGCONE_USE_TOML)
111-
SealLake_Libraries(figcone::figcone_toml)
111+
SealLake_AddLibraries(figcone::figcone_toml)
112112
endif()
113113
if (FIGCONE_USE_ALL OR FIGCONE_USE_XML)
114-
SealLake_Libraries(figcone::figcone_xml)
114+
SealLake_AddLibraries(figcone::figcone_xml)
115115
endif()
116116
if (FIGCONE_USE_ALL OR FIGCONE_USE_YAML)
117-
SealLake_Libraries(figcone::figcone_yaml)
117+
SealLake_AddLibraries(figcone::figcone_yaml)
118118
endif()

include/figcone/config.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef FIGCONE_CONFIG_H
22
#define FIGCONE_CONFIG_H
33

4+
#include "configreader.h"
45
#include "detail/configmacros.h"
56
#include "detail/dict.h"
67
#include "detail/dictcreator.h"

include/figcone/configreader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ constexpr auto canBeReadAsParam()
6262
detail::is_string_streamable_v<tree::sfun::remove_optional_t<TField>> ||
6363
sfun::is_complete_type_v<StringConverter<tree::sfun::remove_optional_t<TField>>>;
6464
}
65-
}; //namespace detail
65+
} //namespace detail
6666

6767
class ConfigReader {
6868

0 commit comments

Comments
 (0)