Skip to content

Commit 5bedd17

Browse files
-update seal_lake to v0.2.0
-update sfun to v5.1.0 -added CMakePresets.json -set version to 2.6.0
1 parent 80d9673 commit 5bedd17

File tree

4 files changed

+152
-24
lines changed

4 files changed

+152
-24
lines changed

.github/workflows/build_and_test.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,33 @@ jobs:
2626
- {
2727
name: "Ubuntu Latest gcc",
2828
os: ubuntu-latest,
29-
cc: "gcc",
30-
cxx: "g++",
31-
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
29+
cmake-preset: "gcc-release"
3230
}
3331
- {
3432
name: "Ubuntu Latest clang",
3533
os: ubuntu-latest,
36-
cc: "clang",
37-
cxx: "clang++",
38-
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused"
34+
cmake-preset: "clang-release"
3935
}
4036
- {
4137
name: "Windows Latest MSVC",
4238
os: windows-latest,
43-
cc: "cl",
44-
cxx: "cl",
45-
flags: "/EHsc /W4 /WX"
39+
cmake-preset: "msvc-release"
4640
}
4741
steps:
48-
- uses: actions/checkout@v3
42+
- name: Install ninja (Windows)
43+
if: matrix.config.os == 'windows-latest'
44+
run: choco install ninja
45+
- name: Install ninja (Linux)
46+
if: matrix.config.os == 'ubuntu-latest'
47+
run: sudo apt install ninja-build
48+
49+
- uses: actions/checkout@v4
50+
- uses: rui314/setup-mold@v1
51+
- uses: hendrikmuhs/[email protected]
52+
- uses: ilammy/msvc-dev-cmd@v1
4953

5054
- name: Configure CMake
51-
run: cmake -B ${{github.workspace}}/build -DENABLE_TESTS=ON -DENABLE_EXAMPLES=ON -DCMDLIME_USE_NAMEOF=${{ matrix.use_nameof }} -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }}"
55+
run: cmake -B ${{github.workspace}}/build -DENABLE_TESTS=ON -DENABLE_EXAMPLES=ON -DCMDLIME_USE_NAMEOF=${{ matrix.use_nameof }} --preset="${{ matrix.config.cmake-preset }}"
5256

5357
- name: Build
5458
run: cmake --build ${{github.workspace}}/build

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
cmake_minimum_required(VERSION 3.18)
2-
project(cmdlime VERSION 2.5.0 DESCRIPTION "C++17 command line parsing library")
3-
include(GNUInstallDirs)
2+
project(cmdlime VERSION 2.6.0 DESCRIPTION "C++17 command line parsing library")
43
include(external/seal_lake)
54

65
option(CMDLIME_USE_NAMEOF "Enable automatic registration of struct field names using the nameof library" OFF)
76
option(CMDLIME_NO_WINDOWS_UNICODE "Disable storing std::wstring and std::filesystem::path with UTF16 encoding on Windows" OFF)
87

98
if (CMDLIME_USE_NAMEOF)
10-
SealLake_IsInstalled(NAMEOF_OPT_INSTALL)
9+
SealLake_IsInstallEnabled(NAMEOF_OPT_INSTALL)
1110
SealLake_Bundle(
1211
NAME nameof
1312
GIT_REPOSITORY https://github.com/Neargye/nameof.git
@@ -18,7 +17,7 @@ endif()
1817
SealLake_Bundle(
1918
NAME cmdlime_sfun
2019
GIT_REPOSITORY https://github.com/kamchatka-volcano/sfun.git
21-
GIT_TAG v5.0.0
20+
GIT_TAG v5.1.0
2221
DESTINATION include/cmdlime/detail/external
2322
DIRECTORIES include/sfun
2423
TEXT_REPLACEMENTS
@@ -37,10 +36,10 @@ SealLake_HeaderOnlyLibrary(
3736
)
3837

3938
if (CMDLIME_USE_NAMEOF)
40-
SealLake_Libraries(
39+
SealLake_AddLibraries(
4140
nameof::nameof
4241
)
43-
SealLake_Dependencies(
42+
SealLake_AddDependencies(
4443
nameof 0.10.2
4544
)
4645
endif()
@@ -53,4 +52,4 @@ if (CMDLIME_NO_CANONICAL_PATHS)
5352
target_compile_definitions(cmdlime INTERFACE CMDLIME_NO_CANONICAL_PATHS)
5453
endif()
5554

56-
SealLake_OptionalBuildSteps(tests examples)
55+
SealLake_OptionalSubProjects(tests examples)

CMakePresets.json

Lines changed: 123 additions & 0 deletions
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"
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

Lines changed: 8 additions & 6 deletions
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)

0 commit comments

Comments
 (0)