Skip to content

Commit

Permalink
-updated seal_lake to v0.2.0;
Browse files Browse the repository at this point in the history
-updated sfun to v5.1.0;
-updated fcgi_responder to v1.7.0;
-updated whaleroute to v3.1.0;
-updated hot_teacup to v3.3.0;
-added CMakePresets.json;
-set version to 0.6.0;
  • Loading branch information
kamchatka-volcano committed Jun 11, 2024
1 parent c6ab5f0 commit f675d9a
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 46 deletions.
55 changes: 25 additions & 30 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: build & test (clang, gcc, MSVC)

on:
workflow_dispatch:
push:
branches: [ "master", "dev" ]
paths-ignore:
Expand All @@ -25,65 +26,59 @@ jobs:
- {
name: "Ubuntu Latest gcc",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
cmake-preset: gcc-release,
cmake_vars: "",
asio_type: "standalone",
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
artifacts-path-postfix: ""
asio_type: "standalone"
}
- {
name: "Ubuntu Latest clang",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
cmake-preset: clang-release,
cmake_vars: "",
asio_type: "standalone",
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
artifacts-path-postfix: ""
asio_type: "standalone"
}
- {
name: "Windows Latest MSVC",
os: windows-latest,
cc: "cl",
cxx: "cl",
cmake-preset: msvc-release,
cmake_vars: "",
asio_type: "standalone",
flags: "/EHsc /W4 /WX",
artifacts-path-postfix: "Release"
asio_type: "standalone"
}
- {
name: "Ubuntu Latest clang (Boost.Asio)",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
cmake-preset: clang-release,
asio_type: "boost",
cmake_vars: "-DASYNCGI_USE_BOOST_ASIO=ON -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake",
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused",
artifacts-path-postfix: ""
}
- {
name: "Windows Latest MSVC (Boost.Asio)",
os: windows-latest,
cc: "cl",
cxx: "cl",
cmake-preset: msvc-release,
asio_type: "boost",
cmake_vars: "-DASYNCGI_USE_BOOST_ASIO=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE='vcpkg/scripts/buildsystems/vcpkg.cmake'",
flags: "/EHsc /W4 /WX",
artifacts-path-postfix: "Release"
cmake_vars: "-DASYNCGI_USE_BOOST_ASIO=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE='vcpkg/scripts/buildsystems/vcpkg.cmake'"
}

steps:
- name: Git checkout
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: Install vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: 31a159c1cae2bf905299085d9ef01bdfea0ca7b8

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=ON ${{ matrix.config.cmake_vars }} -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }}"
run: cmake -B ${{github.workspace}}/build -DENABLE_EXAMPLES=ON ${{ matrix.config.cmake_vars }} --preset="${{ matrix.config.cmake-preset }}"

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
Expand All @@ -92,13 +87,13 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: asyncgi-examples-${{ matrix.config.os }}-${{ matrix.config.asio_type }}-asio
path: build/examples/${{ matrix.config.artifacts-path-postfix }}
path: build/examples/

- name: Upload build test artifact
uses: actions/upload-artifact@v3
with:
name: asyncgi-test-examples-${{ matrix.config.os }}-${{ matrix.config.asio_type }}-asio
path: build/test_examples/${{ matrix.config.artifacts-path-postfix }}
path: build/test_examples/

functional_tests:
name: Functional testing (${{ matrix.config.name }} ${{ matrix.asio_type }}-asio)
Expand All @@ -115,7 +110,7 @@ jobs:
lunchtoast_exec: "lunchtoast.exe",
shell_command: -shell="msys2 -c",
tags: -skip=linux,
nginx_exec: "c:/tools/nginx-1.25.3/nginx.exe",
nginx_exec: "c:/tools/nginx-1.25.5/nginx.exe",
nginx_cfg: "nginx_windows.conf"
}
- {
Expand Down
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.18)
project(asyncgi VERSION 0.4.0 DESCRIPTION "asyncgi - asynchronous FastCGI web application microframework")
project(asyncgi VERSION 0.6.0 DESCRIPTION "asyncgi - asynchronous FastCGI web application microframework")

include(GNUInstallDirs)
include(external/seal_lake)
if (ASYNCGI_USE_BOOST_ASIO)
find_package(Boost REQUIRED COMPONENTS system)
Expand All @@ -12,7 +11,7 @@ endif()
SealLake_Bundle(
NAME asyncgi_sfun
GIT_REPOSITORY https://github.com/kamchatka-volcano/sfun.git
GIT_TAG v5.0.0
GIT_TAG v5.1.0
DESTINATION include/asyncgi/detail/external
DIRECTORIES include/sfun
TEXT_REPLACEMENTS
Expand All @@ -24,15 +23,15 @@ set(ASYNCGI_FCGI_RESPONDER_OBJECT_LIB ON)
SealLake_Bundle(
NAME asyncgi_fcgi_responder
GIT_REPOSITORY https://github.com/kamchatka-volcano/fcgi_responder.git
GIT_TAG v1.6.2
GIT_TAG v1.7.0
TEXT_REPLACEMENTS
"namespace fcgi" "namespace asyncgi::fcgi"
)

SealLake_Bundle(
NAME asyncgi_whaleroute
GIT_REPOSITORY https://github.com/kamchatka-volcano/whaleroute.git
GIT_TAG v3.0.0
GIT_TAG v3.1.0
DESTINATION include/asyncgi/detail/external
DIRECTORIES include/whaleroute
TEXT_REPLACEMENTS
Expand All @@ -44,7 +43,7 @@ set(ASYNCGI_HOT_TEACUP_OBJECT_LIB ON)
SealLake_Bundle(
NAME asyncgi_hot_teacup
GIT_REPOSITORY https://github.com/kamchatka-volcano/hot_teacup.git
GIT_TAG v3.2.0
GIT_TAG v3.3.0
WILDCARDS
include/hot_teacup/*.h
DESTINATION include/asyncgi/http
Expand Down Expand Up @@ -92,12 +91,12 @@ SealLake_StaticLibrary(
)

if (ASYNCGI_USE_BOOST_ASIO)
SealLake_Libraries(Boost::boost)
SealLake_AddLibraries(Boost::boost)
else()
SealLake_Libraries(asio)
SealLake_AddLibraries(asio)
endif()

SealLake_OptionalBuildSteps(examples)
SealLake_OptionalSubProjects(examples)
if (ENABLE_EXAMPLES)
add_subdirectory(test_examples)
endif()
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)
2 changes: 1 addition & 1 deletion include/asyncgi/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ enum ErrorEvent {
RouteParametersError
};

}; //namespace asyncgi
} //namespace asyncgi

#endif //ASYNCGI_EVENTS_H

0 comments on commit f675d9a

Please sign in to comment.