Skip to content

Merge develop to main #53

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

Merged
merged 16 commits into from
May 6, 2025
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
85 changes: 0 additions & 85 deletions .github/workflows/build_cmake.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/build_run_unit_test_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build, run unit tests
name: CMake build and run unit test matrix

on:
push:
branches:
- main
- develop
env:
BUILD_TYPE: Release
jobs:
build_matrix:
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-15]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: checkout
uses: actions/checkout@v4
- name: create-build-dir
run: mkdir build
- name: configure-cmake
run: cd build && cmake -D CHOPS_NET_IP_BUILD_TESTS:BOOL=ON -D CHOPS_NET_IP_BUILD_EXAMPLES:BOOL=ON ..
- name: build
run: cd build && cmake --build . --config $BUILD_TYPE
- name: run-unit-test
run: cd build && ctest -C $BUILD_TYPE
28 changes: 28 additions & 0 deletions .github/workflows/gen_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Build, run unit tests
name: Generate documentation

on:
push:
branches:
- main
jobs:
build_matrix:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: checkout
uses: actions/checkout@v4
- name: run-doxygen
uses: mattnotmitt/doxygen-action@v1.12.0
with:
working-directory: doc
- name: deploy-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/doc_output/html
153 changes: 0 additions & 153 deletions .travis.yml

This file was deleted.

66 changes: 38 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,63 @@
# Copyright 2019-2020 by Cliff Green
# Copyright (c) 2019-2025 by Cliff Green
#
# https://github.com/connectivecpp/chops-net-ip
#
# I'm still learning CMake, so improvement suggestions are always welcome.
#
# The Asio CMake code is taken from CPM.cmake examples/asio-standalone.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# CMake 3.8 required for cxx_std_17 target_compile_features
cmake_minimum_required ( VERSION 3.14 FATAL_ERROR )

cmake_minimum_required ( VERSION 3.12 )
project ( chops_net_ip
LANGUAGES CXX
DESCRIPTION "An asynchronous networking library based on Asio"
HOMEPAGE_URL "https://github.com/connectivecpp/chops-net-ip/" )

option ( CHOPS_NET_IP_OPT_BUILD_TESTS "Build and perform chops-net-ip tests" ON )
option ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES "Build and perform chops-net-ip examples" ON )
option ( CHOPS_NET_IP_OPT_BUILD_DOCS "Build doxygen documentation" OFF )
option ( CHOPS_NET_IP_BUILD_TESTS "Build unit tests" OFF )
option ( CHOPS_NET_IP_BUILD_EXAMPLES "Build examples" OFF )
option ( CHOPS_NET_IP_INSTALL "Install header only library" OFF )

set ( OPTIONS "" )
set ( DEFINITIONS "" )
# add library targets

project ( chops-net-ip VERSION 1.0 LANGUAGES CXX )
add_library ( chops_net_ip INTERFACE )
add_library ( chops::chops_net_ip ALIAS chops_net_ip )

set ( package_name "chops-net-ip" )
# thread support specified in Asio download

set ( include_source_dir "${CMAKE_SOURCE_DIR}/include" )
set ( utility_rack_dir "${CMAKE_SOURCE_DIR}/../utility-rack" )
set ( utility_rack_include_source_dir "${utility_rack_dir}/include" )
set ( third_party_include_source_dir "${utility_rack_dir}/third_party" )
set ( cmake_include_dir "${CMAKE_SOURCE_DIR}/cmake" )
set ( cmake_all_repos_include_dir "${utility_rack_dir}/cmake/all_repos" )
# dependencies needed for main library

include ( cmake/download_cpm.cmake )
CPMAddPackage ( "gh:connectivecpp/shared-buffer@1.0.4" )
CPMAddPackage ( "gh:martinmoene/expected-lite@0.8.0" )

# Interface library:
include ( cmake/download_asio_cpm.cmake )

add_library ( ${package_name} INTERFACE )
# configure library target

target_include_directories ( ${package_name} INTERFACE ${include_source_dir} )
target_include_directories ( ${package_name} INTERFACE ${third_party_include_source_dir} )
target_compile_features ( ${package_name} INTERFACE cxx_std_17)
target_include_directories ( chops_net_ip INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include/> )
target_compile_features ( chops_net_ip INTERFACE cxx_std_20 )

if ( CHOPS_NET_IP_OPT_BUILD_TESTS )
# check to build unit tests
if ( ${CHOPS_NET_IP_BUILD_TESTS} )
enable_testing()
add_subdirectory ( test )
endif()
endif ()

if ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES )
# check to build example code
if ( ${CHOPS_NET_IP_BUILD_EXAMPLES} )
add_subdirectory ( example )
endif()
endif ()

if ( CHOPS_NET_IP_OPT_BUILD_DOCS )
add_subdirectory ( doc )
endif()
# check to install
if ( ${CHOPS_NET_IP_INSTALL} )
set ( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt )
include ( CPack )
endif ()

# end of file

Loading