Skip to content

Commit e16ef3c

Browse files
Merge pull request #53 from connectivecpp/develop
Merge develop to main
2 parents 6a1fd59 + e4f0255 commit e16ef3c

File tree

75 files changed

+1321
-1340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1321
-1340
lines changed

.github/workflows/build_cmake.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Build, run unit tests
2+
name: CMake build and run unit test matrix
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
env:
10+
BUILD_TYPE: Release
11+
jobs:
12+
build_matrix:
13+
strategy:
14+
matrix:
15+
# os: [ubuntu-latest, windows-latest, macos-15]
16+
os: [ubuntu-latest, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
defaults:
19+
run:
20+
shell: bash
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v4
24+
- name: create-build-dir
25+
run: mkdir build
26+
- name: configure-cmake
27+
run: cd build && cmake -D CHOPS_NET_IP_BUILD_TESTS:BOOL=ON -D CHOPS_NET_IP_BUILD_EXAMPLES:BOOL=ON ..
28+
- name: build
29+
run: cd build && cmake --build . --config $BUILD_TYPE
30+
- name: run-unit-test
31+
run: cd build && ctest -C $BUILD_TYPE

.github/workflows/gen_docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Build, run unit tests
2+
name: Generate documentation
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
build_matrix:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
runs-on: ${{ matrix.os }}
14+
defaults:
15+
run:
16+
shell: bash
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v4
20+
- name: run-doxygen
21+
uses: mattnotmitt/doxygen-action@v1.12.0
22+
with:
23+
working-directory: doc
24+
- name: deploy-pages
25+
uses: peaceiris/actions-gh-pages@v4
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: ./doc/doc_output/html

.travis.yml

Lines changed: 0 additions & 153 deletions
This file was deleted.

CMakeLists.txt

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

8-
# CMake 3.8 required for cxx_std_17 target_compile_features
12+
cmake_minimum_required ( VERSION 3.14 FATAL_ERROR )
913

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

12-
option ( CHOPS_NET_IP_OPT_BUILD_TESTS "Build and perform chops-net-ip tests" ON )
13-
option ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES "Build and perform chops-net-ip examples" ON )
14-
option ( CHOPS_NET_IP_OPT_BUILD_DOCS "Build doxygen documentation" OFF )
19+
option ( CHOPS_NET_IP_BUILD_TESTS "Build unit tests" OFF )
20+
option ( CHOPS_NET_IP_BUILD_EXAMPLES "Build examples" OFF )
21+
option ( CHOPS_NET_IP_INSTALL "Install header only library" OFF )
1522

16-
set ( OPTIONS "" )
17-
set ( DEFINITIONS "" )
23+
# add library targets
1824

19-
project ( chops-net-ip VERSION 1.0 LANGUAGES CXX )
25+
add_library ( chops_net_ip INTERFACE )
26+
add_library ( chops::chops_net_ip ALIAS chops_net_ip )
2027

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

23-
set ( include_source_dir "${CMAKE_SOURCE_DIR}/include" )
24-
set ( utility_rack_dir "${CMAKE_SOURCE_DIR}/../utility-rack" )
25-
set ( utility_rack_include_source_dir "${utility_rack_dir}/include" )
26-
set ( third_party_include_source_dir "${utility_rack_dir}/third_party" )
27-
set ( cmake_include_dir "${CMAKE_SOURCE_DIR}/cmake" )
28-
set ( cmake_all_repos_include_dir "${utility_rack_dir}/cmake/all_repos" )
30+
# dependencies needed for main library
2931

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

31-
# Interface library:
36+
include ( cmake/download_asio_cpm.cmake )
3237

33-
add_library ( ${package_name} INTERFACE )
38+
# configure library target
3439

35-
target_include_directories ( ${package_name} INTERFACE ${include_source_dir} )
36-
target_include_directories ( ${package_name} INTERFACE ${third_party_include_source_dir} )
37-
target_compile_features ( ${package_name} INTERFACE cxx_std_17)
40+
target_include_directories ( chops_net_ip INTERFACE
41+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
42+
$<INSTALL_INTERFACE:include/> )
43+
target_compile_features ( chops_net_ip INTERFACE cxx_std_20 )
3844

39-
if ( CHOPS_NET_IP_OPT_BUILD_TESTS )
45+
# check to build unit tests
46+
if ( ${CHOPS_NET_IP_BUILD_TESTS} )
4047
enable_testing()
4148
add_subdirectory ( test )
42-
endif()
49+
endif ()
4350

44-
if ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES )
51+
# check to build example code
52+
if ( ${CHOPS_NET_IP_BUILD_EXAMPLES} )
4553
add_subdirectory ( example )
46-
endif()
54+
endif ()
4755

48-
if ( CHOPS_NET_IP_OPT_BUILD_DOCS )
49-
add_subdirectory ( doc )
50-
endif()
56+
# check to install
57+
if ( ${CHOPS_NET_IP_INSTALL} )
58+
set ( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt )
59+
include ( CPack )
60+
endif ()
5161

5262
# end of file
5363

0 commit comments

Comments
 (0)