Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cmakelists #328

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 53 additions & 0 deletions .cmake-format
@@ -0,0 +1,53 @@
# notes for additional commands
#
# nargs: '*' to allow multiple arguments
# kwargs: &fookwargs to definite keyword arguments
# kwargs: *fookwargs to use the same keyword arguments as fookwargs
# NAME: 1 to allow single keyword arguments
# NAME: + to allow multiple keyword arguments
# NAME: * to allow multiple keyword arguments
# spelling: FOO to use foo to FOO spelling

parse:
additional_commands:
FetchContent_Declare:
pargs:
nargs: '*'
flags: []
kwargs:
GIT_TAG: 1
GITHUB_REPOSITORY: 1
GITLAB_REPOSITORY: 1
GIT_REPOSITORY: 1
SVN_REPOSITORY: 1
SVN_REVISION: 1
URL: 1
URL_HASH: 1
URL_MD5: 1
FIND_PACKAGE_ARGS: +
FetchContent_MakeAvailable:
pargs:
nargs: '*'
flags: []
execute_process:
pargs:
nargs: '*'
flags: []
kwargs:
COMMAND: +
WORKING_DIRECTORY: 1
set_target_properties:
pargs:
nargs: '*'
flags: []
kwargs:
PROPERTIES: +
IMPORTED_LOCATION: 1
INTERFACE_INCLUDE_DIRECTORIES: 1
format:
tab_size: 2
line_width: 120
autosort: true
dangle_parens: true
max_subgroups_hwrap: 2
max_pargs_hwrap: 3
28 changes: 13 additions & 15 deletions .github/workflows/lint.yml
Expand Up @@ -14,20 +14,18 @@ jobs:
fail-fast: false

steps:
- name: Checkout Trantor source code
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: (Linux) Install dependencies
run: |
# Installing packages might fail as the github image becomes outdated
sudo apt update
sudo apt install dos2unix clang-format
- name: (Linux) Install dependencies
run: |
# Installing packages might fail as the github image becomes outdated
sudo apt update
sudo apt install dos2unix clang-format
pip install cmake-format

- name: Lint
if: matrix.os == 'ubuntu-20.04'
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: bash
run: ./format.sh && git diff --exit-code
- name: Lint
run: ./format.sh && git diff --exit-code
104 changes: 55 additions & 49 deletions .github/workflows/macos-clang.yml
Expand Up @@ -8,64 +8,70 @@ on:

jobs:
build:
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
runs-on: macos-latest
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
strategy:
fail-fast: false
matrix:
link: [ 'STATIC', 'SHARED' ]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: ['Debug', 'Release']
tls-provider: ['', 'openssl', 'botan']
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
build-type: ["Debug", "Release"]
# Support (none, openssl, botan-3, auto)
tls-provider: ["none", "openssl", "botan-3"]

steps:
- name: Install dependencies
# botan v3
run: |
brew install botan spdlog
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Install gtest
run: |
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
tar xf v1.13.0.tar.gz
cd googletest-1.13.0
cmake .
make && sudo make install
- name: Install dependencies
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
sh deps.macos-12.sh

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Configure Cmake [ BUILD_DEPENDENCIES OFF | SPDLOG OFF | C-ARES OFF ]
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DBUILD_DEPENDENCIES=OFF \
-DTRANTOR_USE_SPDLOG=OFF \
-DTRANTOR_USE_C-ARES=OFF \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- name: Create build directory
run: |
mkdir build
- name: Build
working-directory: ./build
run: |
make -j

- name: Create Build Environment & Configure Cmake
shell: bash
working-directory: ./build
run: |
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
cmake .. \
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DCMAKE_INSTALL_PREFIX=../install \
-DUSE_SPDLOG=ON \
-DBUILD_TESTING=ON \
- name: Test
working-directory: ./build
run: |
make test

- name: Build
shell: bash
working-directory: ./build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
sudo make && sudo make install
- name: Configure Cmake [ BUILD_DEPENDENCIES OFF | SPDLOG ON | C-ARES ON ]
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DBUILD_DEPENDENCIES=OFF \
-DTRANTOR_USE_SPDLOG=ON \
-DTRANTOR_USE_C-ARES=ON \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- name: Test
working-directory: ./build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
make test
- name: Build
working-directory: ./build
run: |
make -j

- name: Test
working-directory: ./build
run: |
make test
118 changes: 56 additions & 62 deletions .github/workflows/rockylinux-gcc.yml
Expand Up @@ -8,81 +8,75 @@ on:

jobs:
build:
name: '${{matrix.link}}-${{matrix.build-type}}-${{matrix.tls-provider}}'
name: "${{matrix.link}}-${{matrix.build-type}}-TLS:${{matrix.tls-provider}}"
runs-on: ubuntu-latest
container:
env:
shared: ${{matrix.link == 'SHARED' && 'ON' || 'OFF'}}
container:
image: rockylinux:9.3
options: --user root
strategy:
fail-fast: false
matrix:
link: [ 'STATIC', 'SHARED' ]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: ['Debug', 'Release']
# TODO: ubuntu botan is v2, v2 support is removed
# tls-provider: ['', 'openssl', 'botan']
tls-provider: ['', 'openssl']
link: ["STATIC", "SHARED"]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, MinSizeRel, etc.)
build-type: ["Debug", "Release"]
# Support (none, openssl, botan-3, auto)
tls-provider: ["none", "openssl"]

steps:
- name: Install dependencies
run: |
dnf install gcc-c++ cmake git wget -y
- name: Install build dependencies
run: |
dnf install git cmake gcc gcc-c++ -y

- name: Install dependencies - spdlog
run: |
git clone https://github.com/gabime/spdlog.git
cd spdlog && mkdir build && cd build
cmake .. && make -j
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Install dependencies - OpenSSL
if: matrix.tls-provider == 'openssl'
run: |
dnf install openssl-devel -y

- name: Install gtest
run: |
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
tar xf v1.13.0.tar.gz
cd googletest-1.13.0
cmake .
make -j && make install
- name: Install dependencies
run: |
sh ./deps.rockylinux-9.sh

- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Configure Cmake [ BUILD_DEPENDENCIES OFF | SPDLOG OFF | C-ARES OFF ]
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DBUILD_DEPENDENCIES=OFF \
-DTRANTOR_USE_SPDLOG=OFF \
-DTRANTOR_USE_C-ARES=OFF \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- name: Create build directory
run: |
mkdir build
- name: Build
working-directory: ./build
run: |
make -j

- name: Create Build Environment & Configure Cmake
shell: bash
working-directory: ./build
if: ${{matrix.link}} == "SHARED"
run: |
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
cmake .. \
-DTRANTOR_USE_TLS=${{matrix.tls-provider}} \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DCMAKE_INSTALL_PREFIX=../install \
-DUSE_SPDLOG=ON \
-DBUILD_TESTING=ON
- name: Test
working-directory: ./build
run: |
make test

- name: Build
shell: bash
working-directory: ./build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
make && make install
- name: Configure Cmake [ BUILD_DEPENDENCIES OFF | SPDLOG ON | C-ARES ON ]
run: |
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DBUILD_SHARED_LIBS=$shared \
-DBUILD_DEPENDENCIES=OFF \
-DTRANTOR_USE_SPDLOG=ON \
-DTRANTOR_USE_C-ARES=ON \
-DTRANTOR_TLS_PROVIDER=${{matrix.tls-provider}} \
-DBUILD_TESTING=ON

- name: Test
working-directory: ./build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
make test
- name: Build
working-directory: ./build
run: |
make -j

- name: Test
working-directory: ./build
run: |
make test