Skip to content

Commit

Permalink
-update seal_lake to v0.2.0
Browse files Browse the repository at this point in the history
-update sfun to v5.1.0
-added CMakePresets.json
-set version to 2.6.0
  • Loading branch information
kamchatka-volcano committed May 19, 2024
1 parent 80d9673 commit 6bbfafe
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 9 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ jobs:
flags: "/EHsc /W4 /WX"
}
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/[email protected]
- uses: ilammy/msvc-dev-cmd@v1

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DENABLE_TESTS=ON -DENABLE_EXAMPLES=ON -DCMDLIME_USE_NAMEOF=${{ matrix.use_nameof }} -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }}"
Expand Down
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 3.18)
project(cmdlime VERSION 2.5.0 DESCRIPTION "C++17 command line parsing library")
include(GNUInstallDirs)
project(cmdlime VERSION 2.6.0 DESCRIPTION "C++17 command line parsing library")
include(external/seal_lake)

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

if (CMDLIME_USE_NAMEOF)
SealLake_IsInstalled(NAMEOF_OPT_INSTALL)
SealLake_IsInstallRequired(NAMEOF_OPT_INSTALL)
SealLake_Bundle(
NAME nameof
GIT_REPOSITORY https://github.com/Neargye/nameof.git
Expand All @@ -18,7 +17,7 @@ endif()
SealLake_Bundle(
NAME cmdlime_sfun
GIT_REPOSITORY https://github.com/kamchatka-volcano/sfun.git
GIT_TAG v5.0.0
GIT_TAG v5.1.0
DESTINATION include/cmdlime/detail/external
DIRECTORIES include/sfun
TEXT_REPLACEMENTS
Expand All @@ -37,10 +36,10 @@ SealLake_HeaderOnlyLibrary(
)

if (CMDLIME_USE_NAMEOF)
SealLake_Libraries(
SealLake_AddLibraries(
nameof::nameof
)
SealLake_Dependencies(
SealLake_AddDependencies(
nameof 0.10.2
)
endif()
Expand All @@ -53,4 +52,4 @@ if (CMDLIME_NO_CANONICAL_PATHS)
target_compile_definitions(cmdlime INTERFACE CMDLIME_NO_CANONICAL_PATHS)
endif()

SealLake_OptionalBuildSteps(tests examples)
SealLake_OptionalSubProjects(tests examples)
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"
}
},
{
"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"
}
}
]
}
3 changes: 2 additions & 1 deletion external/seal_lake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ include(FetchContent)
Set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(seal_lake
GIT_REPOSITORY https://github.com/kamchatka-volcano/seal_lake.git
GIT_TAG master
GIT_TAG v0.2.0
)
FetchContent_MakeAvailable(seal_lake)

include(${seal_lake_SOURCE_DIR}/seal_lake.cmake)

0 comments on commit 6bbfafe

Please sign in to comment.