Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & Test with modules

on:
push:
branches: [master]
pull_request:
branches: [master]
paths:
- "CMakeLists.txt"
- "cmake/**"
- "include/jwt-cpp/**"
- "tests/cmake/**"
- ".github/actions/**"
- ".github/workflows/cmake.yml"

jobs:
build:
name: ${{ matrix.runs_on }}-${{ matrix.compiler }}-${{ matrix.configure_preset }}
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
include:
- runs_on: windows-2025-vs2026
compiler: msvc-14.50
configure_preset: "x64-vs-modules"
build_preset: "x64-vs-modules-build"
test_preset : "x64-vs-modules-test"
# To be uncommented once GitHub Actions adds GCC 15 with Ubuntu 26
# - runs_on: ubuntu-latest
# compiler: gcc-15
# configure_preset: "linux-debug"
# build_preset: "linux-debug-build"
# test_preset : "linux-debug-test"
# - runs_on: ubuntu-latest
# compiler: clang-18
# cc: clang
# cxx: clang++
# configure_preset: "linux-debug-modules"
# build_preset: "linux-debug-modules-build"
# test_preset : "linux-debug-modules-test"
steps:

- uses: actions/checkout@v6

- uses: lukka/get-cmake@latest

- name: "Build & Test"
uses: lukka/run-cmake@v10
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
with:
configurePreset: ${{ matrix.configure_preset }}
buildPreset: ${{ matrix.build_preset }}
testPreset: ${{ matrix.test_preset }}
57 changes: 57 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,77 @@
"JWT_BUILD_EXAMPLES": "ON",
"JWT_BUILD_TESTS": "ON"
}
},
{
"name": "windows-vs-base",
"hidden": true,
"generator": "Visual Studio 18 2026",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-vs-modules",
"displayName": "x64 (VS generator) with Modules",
"inherits": "windows-vs-base",
"architecture": "x64",
"cacheVariables": {
"JWT_ENABLE_MODULES": "ON",
"JWT_USE_IMPORT_STD": "ON",
"JWT_BUILD_EXAMPLES": "ON"
}
},
{
"name": "linux-debug-modules",
"displayName": "Linux Debug with Modules",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"JWT_ENABLE_MODULES": "ON",
"JWT_USE_IMPORT_STD": "ON",
"JWT_BUILD_EXAMPLES": "ON"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
}
],
"buildPresets": [
{
"name": "dev",
"configurePreset": "dev",
"configuration": "Debug"
},
{
"name": "x64-vs-modules-build",
"configurePreset": "x64-vs-modules"
},
{
"name": "linux-debug-modules-build",
"configurePreset": "linux-debug-modules"
}
],
"testPresets": [
{
"name": "dev",
"displayName": "Run all tests",
"configurePreset": "dev"
},
{
"name": "x64-vs-modules-test",
"configurePreset": "x64-vs-modules"
},
{
"name": "linux-debug-modules-test",
"configurePreset": "linux-debug-modules"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ If you are looking to issue or verify more unique tokens, checkout out the [exam
Building on the goal of providing flexibility.

#### Modules support
jwt-cpp supports C++20/23 modules. There are two configuration options `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23).
jwt-cpp supports C++20/23 modules. There are two configuration options: `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23).
CMake example:
```cmake
set(JWT_ENABLE_MODULES ON)
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It's strongly recommended to use a package manager, as JWT-CPP has dependencies
When manually adding this dependency, and the dependencies this has, check the GitHub Actions and Workflows for some inspiration about how to go about it.

#### Modules support
jwt-cpp supports C++20/23 modules. There are two configuration options `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23).
jwt-cpp supports C++20/23 modules. There are two configuration options: `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23).
CMake example:
```cmake
set(JWT_ENABLE_MODULES ON)
Expand Down