diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a9eed99d38..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2.0 -jobs: - build: - docker: - - image: madmongo1/fedora-devel:latest - - working_directory: /tmp - - steps: - - run: - name: fix ssh keys - working_directory: ~ - command: | - ssh-keyscan github.com >> githubKey - ssh-keygen -lf githubKey - cat githubKey >> ~/.ssh/known_hosts - - - run: - name: clone boost - working_directory: /tmp - command: | - BOOST_BRANCH=master - if [ "${CIRCLE_BRANCH}" != "master" -a "${CIRCLE_BRANCH}" != "refs/heads/master" ] - then - BOOST_BRANCH=develop - fi - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git - - - run: - name: update submodules - working_directory: /tmp/boost - command: | - git submodule update --init --recursive --depth 10 --jobs 4 - - - run: - name: checkout beast version - working_directory: /tmp/boost/libs/beast - command: | - git remote add circle ${CIRCLE_REPOSITORY_URL} - git fetch circle - git checkout circle/${CIRCLE_BRANCH} - git submodule update --init --recursive - - - run: - name: bootstrap - working_directory: /tmp/boost - command: ./bootstrap.sh - - - run: - name: copy headers - working_directory: /tmp/boost - command: ./b2 headers - - - run: - name: build tests - working_directory: /tmp/boost - command: | - ./b2 -j 2 toolset=clang stdlib=libc++ cxxstd=latest cxxflags=-fcoroutines-ts variant=release,debug libs/beast/test - ./b2 -j 2 cxxstd=latest libs/beast/test - ./b2 -j 2 cxxstd=latest libs/beast/example diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 7625477d41..0000000000 --- a/.dockerignore +++ /dev/null @@ -1,8 +0,0 @@ -# ignore cmake builds -cmake-build-*/ - -# ignore b2 builds -bin.v2/ -*/bin.v2/ -.git/ -*/.git/ \ No newline at end of file diff --git a/.dockers/centos-7/Dockerfile b/.dockers/centos-7/Dockerfile deleted file mode 100644 index 79794e90da..0000000000 --- a/.dockers/centos-7/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM centos:7 - -RUN yum update -y -RUN yum install -y epel-release -RUN yum -y groupinstall "Development Tools" -RUN yum install -y cmake openssl-devel clang libcxx-devel libcxxabi-devel bzip2-devel which zlib-devel - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/centos-7/user-config.jam /devel/boost/ -COPY .dockers/centos-7/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/centos-7/tests.sh b/.dockers/centos-7/tests.sh deleted file mode 100755 index 2c91e144c3..0000000000 --- a/.dockers/centos-7/tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -#cxxstd=2a,17,14,11 \ - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/centos-7/user-config.jam b/.dockers/centos-7/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/centos-7/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/debian-10/Dockerfile b/.dockers/debian-10/Dockerfile deleted file mode 100644 index 5707d7f818..0000000000 --- a/.dockers/debian-10/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM debian:10 - -RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-dev libc++abi-dev libbz2-dev zlib1g-dev mlocate - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/debian-10/user-config.jam /devel/boost/ -COPY .dockers/debian-10/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/debian-10/tests.sh b/.dockers/debian-10/tests.sh deleted file mode 100755 index ff842c5c9d..0000000000 --- a/.dockers/debian-10/tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=2a,17,14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/debian-10/user-config.jam b/.dockers/debian-10/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/debian-10/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/debian-9/Dockerfile b/.dockers/debian-9/Dockerfile deleted file mode 100644 index 91f2bbfe22..0000000000 --- a/.dockers/debian-9/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM debian:9 - -RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-dev libc++abi-dev libbz2-dev zlib1g-dev mlocate - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/debian-9/user-config.jam /devel/boost/ -COPY .dockers/debian-9/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/debian-9/tests.sh b/.dockers/debian-9/tests.sh deleted file mode 100755 index e26fe37424..0000000000 --- a/.dockers/debian-9/tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# modify cxxstd=2a,17,14,11 - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/debian-9/user-config.jam b/.dockers/debian-9/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/debian-9/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/fedora-32/Dockerfile b/.dockers/fedora-32/Dockerfile deleted file mode 100644 index 07c025e81f..0000000000 --- a/.dockers/fedora-32/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM fedora:32 - -RUN dnf update -y -RUN dnf -y groupinstall "Development Tools" -RUN dnf install -y cmake openssl-devel clang libcxx-devel libcxxabi-devel bzip2-devel which zlib-devel - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/fedora-32/user-config.jam /devel/boost/ -COPY .dockers/fedora-32/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -#RUN cd libs/beast && git checkout develop && git pull origin develop -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/fedora-32/tests.sh b/.dockers/fedora-32/tests.sh deleted file mode 100755 index ff842c5c9d..0000000000 --- a/.dockers/fedora-32/tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=2a,17,14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/fedora-32/user-config.jam b/.dockers/fedora-32/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/fedora-32/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/ubuntu-16/Dockerfile b/.dockers/ubuntu-16/Dockerfile deleted file mode 100644 index 038136ea57..0000000000 --- a/.dockers/ubuntu-16/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-dev libc++abi-dev libbz2-dev zlib1g-dev - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/ubuntu-16/user-config.jam /devel/boost/ -COPY .dockers/ubuntu-16/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/ubuntu-16/tests.sh b/.dockers/ubuntu-16/tests.sh deleted file mode 100755 index e1706eab6f..0000000000 --- a/.dockers/ubuntu-16/tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# cxxstd=2a,17,14,11 \ - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/ubuntu-16/user-config.jam b/.dockers/ubuntu-16/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/ubuntu-16/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/ubuntu-18-cxxstd-17/Dockerfile b/.dockers/ubuntu-18-cxxstd-17/Dockerfile deleted file mode 100644 index dcb2e0031e..0000000000 --- a/.dockers/ubuntu-18-cxxstd-17/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-10-dev libc++abi-10-dev libbz2-dev zlib1g-dev - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/ubuntu-18-cxxstd-17/user-config.jam /devel/boost/ -COPY .dockers/ubuntu-18-cxxstd-17/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/ubuntu-18-cxxstd-17/tests.sh b/.dockers/ubuntu-18-cxxstd-17/tests.sh deleted file mode 100755 index ac5733970c..0000000000 --- a/.dockers/ubuntu-18-cxxstd-17/tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# cxxstd=2a,17,14,11 \ - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=17,14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/ubuntu-18-cxxstd-17/user-config.jam b/.dockers/ubuntu-18-cxxstd-17/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/ubuntu-18-cxxstd-17/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/ubuntu-18/Dockerfile b/.dockers/ubuntu-18/Dockerfile deleted file mode 100644 index 9cb6a163dd..0000000000 --- a/.dockers/ubuntu-18/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-10-dev libc++abi-10-dev libbz2-dev zlib1g-dev - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/ubuntu-18/user-config.jam /devel/boost/ -COPY .dockers/ubuntu-18/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/ubuntu-18/tests.sh b/.dockers/ubuntu-18/tests.sh deleted file mode 100755 index ff842c5c9d..0000000000 --- a/.dockers/ubuntu-18/tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=2a,17,14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/ubuntu-18/user-config.jam b/.dockers/ubuntu-18/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/ubuntu-18/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/ubuntu-20/Dockerfile b/.dockers/ubuntu-20/Dockerfile deleted file mode 100644 index f1d996a74b..0000000000 --- a/.dockers/ubuntu-20/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:20.04 - -RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-10-dev libc++abi-10-dev libbz2-dev zlib1g-dev mlocate - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/ubuntu-20/user-config.jam /devel/boost/ -COPY .dockers/ubuntu-20/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/ubuntu-20/tests.sh b/.dockers/ubuntu-20/tests.sh deleted file mode 100755 index ff842c5c9d..0000000000 --- a/.dockers/ubuntu-20/tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=2a,17,14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/ubuntu-20/user-config.jam b/.dockers/ubuntu-20/user-config.jam deleted file mode 100644 index 7187270367..0000000000 --- a/.dockers/ubuntu-20/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : -stdlib=libc++ "-Wno-c99-extensions" -stdlib=libc++ ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/ubuntu-focal/Dockerfile b/.dockers/ubuntu-focal/Dockerfile deleted file mode 100644 index 6535e4c9d3..0000000000 --- a/.dockers/ubuntu-focal/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ubuntu:focal - -RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata -RUN apt-get install -y build-essential -RUN apt-get install -y git cmake libssl-dev clang libc++-dev libc++abi-dev libbz2-dev zlib1g-dev - -WORKDIR /devel -RUN git clone -b develop https://github.com/boostorg/boost.git -COPY .dockers/ubuntu-focal/user-config.jam /devel/boost/ -COPY .dockers/ubuntu-focal/tests.sh /devel/boost/ - -WORKDIR /devel/boost -RUN git submodule update --init --recursive -COPY . /devel/boost/libs/beast/ - -RUN ./bootstrap.sh -RUN ./b2 toolset=gcc variant=release cxxstd=latest headers -RUN ./tests.sh || true diff --git a/.dockers/ubuntu-focal/tests.sh b/.dockers/ubuntu-focal/tests.sh deleted file mode 100755 index e1706eab6f..0000000000 --- a/.dockers/ubuntu-focal/tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# cxxstd=2a,17,14,11 \ - -./b2 --user-config=./user-config.jam \ - toolset=clang,gcc \ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts \ - variant=release \ - cxxstd=14,11 \ - -j`grep processor /proc/cpuinfo | wc -l` \ - -q \ - libs/beast/test libs/beast/example diff --git a/.dockers/ubuntu-focal/user-config.jam b/.dockers/ubuntu-focal/user-config.jam deleted file mode 100644 index 544e0eb1f3..0000000000 --- a/.dockers/ubuntu-focal/user-config.jam +++ /dev/null @@ -1,11 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -using gcc : : g++ : "-Wno-c99-extensions" ; diff --git a/.dockers/windows-vs-32/Dockerfile b/.dockers/windows-vs-32/Dockerfile deleted file mode 100644 index a4be3ba375..0000000000 --- a/.dockers/windows-vs-32/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -# escape=` - -# Use the latest Windows Server Core image with .NET Framework 4.8. -FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 - -# Restore the default Windows shell for correct batch processing. -SHELL ["cmd", "/S", "/C"] - -# Download the Build Tools bootstrapper. -ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe - -RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache ` - --installPath C:\BuildTools ` - --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended ` - || IF "%ERRORLEVEL%"=="3010" EXIT 0 - -# -------------- -# Boost Section -# -------------- - -WORKDIR C:\ -RUN powershell -Command iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) -RUN powershell -Command Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') -RUN choco install -y git.install -RUN choco install -y python --version 3.8.3 - -# chocolaty install of openssl 1.1.1 -# RUN choco install -y openssl --x86 --version 1.1.1.700 -# RUN mklink /D "OpenSSL" "Program Files (x86)\\OpenSSL-Win32" - -# scoop install of openssl 1.0.2u -# RUN powershell -Command scoop install openssl@1.0.2u -a 32bit -g -# RUN mklink /D "OpenSSL" "ProgramData\\scoop\\apps\\openssl\\current" - -# scoop install of openssl 1.1.1g -RUN powershell -Command scoop install openssl@1.1.1g -a 32bit -g -RUN mklink /D "OpenSSL" "ProgramData\\scoop\\apps\\openssl\\current" - -RUN mkdir C:\devel - -WORKDIR C:\devel -RUN git.exe clone -b develop https://github.com/boostorg/boost.git - -WORKDIR C:\devel\boost -RUN git.exe submodule update --init --recursive -COPY . C:\devel\boost\libs\beast\ -COPY ".dockers\\windows-vs-32\\user-config.jam" C:\devel\boost\ -COPY ".dockers\\windows-vs-32\\tests.bat" C:\devel\boost\ - -RUN C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars32.bat && bootstrap.bat -RUN C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars32.bat && b2 variant=release cxxstd=latest headers - -# Choose one of the following two lines. The second will succeed regardless of the test results, if you'd prefer the build to complete. -# RUN C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars32.bat && set OPENSSL_ROOT=C:/OpenSSL&& tests.bat -RUN C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars32.bat && set OPENSSL_ROOT=C:/OpenSSL&& tests.bat || ver>nul - -ENTRYPOINT ["C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars32.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/.dockers/windows-vs-32/README.md b/.dockers/windows-vs-32/README.md deleted file mode 100644 index a4dc437f64..0000000000 --- a/.dockers/windows-vs-32/README.md +++ /dev/null @@ -1,8 +0,0 @@ - -Build docker image from root directory of the repository: - -``` -docker -f .dockers\windows-vs-32\Dockerfile . -``` - - diff --git a/.dockers/windows-vs-32/tests.bat b/.dockers/windows-vs-32/tests.bat deleted file mode 100644 index ba672c66b8..0000000000 --- a/.dockers/windows-vs-32/tests.bat +++ /dev/null @@ -1,13 +0,0 @@ - -set PROCESSORS=%NUMBER_OF_PROCESSORS% - -REM Optionally throttle cpus: -REM if %PROCESSORS% GTR 2 set PROCESSORS=2 - -b2 --user-config=user-config.jam ^ - asio.mode=dflt,nodep,nots,ts,nodep-nots,nodep-ts ^ - variant=release ^ - cxxstd=2a,17,14,11 ^ - -j%PROCESSORS% ^ - -q ^ - libs/beast/test libs/beast/example diff --git a/.dockers/windows-vs-32/user-config.jam b/.dockers/windows-vs-32/user-config.jam deleted file mode 100644 index f99577057b..0000000000 --- a/.dockers/windows-vs-32/user-config.jam +++ /dev/null @@ -1,21 +0,0 @@ -import feature ; - -feature.feature asio.mode : dflt nodep nots ts nodep-nots nodep-ts : propagated composite ; -feature.compose nodep : "BOOST_ASIO_NO_DEPRECATED" ; -feature.compose nots : "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose ts : "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; -feature.compose nodep-nots : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_NO_TS_EXECUTORS" ; -feature.compose nodep-ts : "BOOST_ASIO_NO_DEPRECATED" "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT" ; - -#using clang : : clang++ : "libc++" "-Wno-c99-extensions" ; -#using gcc : : g++ : "-Wno-c99-extensions" ; - -#import os ; -#local OPENSSL_ROOT = [ os.environ OPENSSL_ROOT ] ; -#project -# : requirements -# $(OPENSSL_ROOT)/include -# debug:$(OPENSSL_ROOT)/lib -# windowsdebug:$(OPENSSL_ROOT)/debug/lib -# release:$(OPENSSL_ROOT)/lib -# ; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dabf416a77..c1889aaddb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,7 +309,7 @@ jobs: echo "skipping: ${toolset} ${standard} ${variant}" else echo "running: ${toolset} ${standard} ${variant}" - ../../b2 -j3 test toolset=${toolset} cxxstd=${standard} variant=${variant} + ../../b2 test toolset=${toolset} cxxstd=${standard} variant=${variant} err=$? fi done @@ -484,8 +484,353 @@ jobs: for address_model in ${address_models} ; do for variant in ${variants} ; do echo "running: ${toolset} ${standard} ${address_model} ${variant}" - ../../b2 -j3 ${{matrix.cxxflags}} test toolset=${toolset} cxxstd=${standard} address-model=${address_model} variant=${variant} || exit $? + ../../b2 ${{matrix.cxxflags}} test toolset=${toolset} cxxstd=${standard} address-model=${address_model} variant=${variant} || exit $? done done done done + + posix-cmake-subdir: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + - os: ubuntu-22.04 + - os: ubuntu-24.04 + - os: macos-13 + - os: macos-14 + - os: macos-15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + if: matrix.install + run: sudo apt-get -y install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Use library with add_subdirectory + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_test + mkdir __build__ && cd __build__ + cmake .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-install: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + - os: ubuntu-22.04 + - os: ubuntu-24.04 + - os: macos-13 + - os: macos-14 + - os: macos-15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + if: matrix.install + run: sudo apt-get -y install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local .. + + - name: Install + run: | + cd ../boost-root/__build__ + cmake --build . --target install + + - name: Use the installed library + run: | + cd ../boost-root/libs/$LIBRARY/test/cmake_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=~/.local .. + cmake --build . + ctest --output-on-failure --no-tests=error + + posix-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + - os: ubuntu-22.04 + - os: ubuntu-24.04 + - os: macos-13 + - os: macos-14 + - os: macos-15 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + if: matrix.install + run: sudo apt-get -y install ${{matrix.install}} + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON .. + + - name: Build tests + run: | + cd ../boost-root/__build__ + cmake --build . --target tests -j $(nproc || getconf _NPROCESSORS_ONLN) + + - name: Run tests + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error + + windows-cmake-subdir: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Use library with add_subdirectory (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_test + mkdir __build__ && cd __build__ + cmake -DCMAKE_TOOLCHAIN_FILE="../../../cmake/toolchains/msvc.cmake" .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use library with add_subdirectory (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-install: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DCMAKE_TOOLCHAIN_FILE="../libs/%LIBRARY%/cmake/toolchains/msvc.cmake" .. + + - name: Install (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Debug + + - name: Install (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Release + + - name: Use the installed library (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix -DCMAKE_TOOLCHAIN_FILE="../../../cmake/toolchains/msvc.cmake" .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use the installed library (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE="../libs/%LIBRARY%/cmake/toolchains/msvc.cmake" .. + + - name: Build tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Debug -j %NUMBER_OF_PROCESSORS% + + - name: Run tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Debug + + - name: Build tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Release -j %NUMBER_OF_PROCESSORS% + + - name: Run tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Release diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 9f83d4d6b3..267b62d08d 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -63,7 +63,8 @@ jobs: cmake \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DBeast_BUILD_TESTS=ON \ - -DBeast_BUILD_FUZZERS=ON \ + -DBOOST_BEAST_BUILD_EXAMPLES=OFF \ + -DBOOST_BEAST_BUILD_TESTS=ON \ + -DBOOST_BEAST_BUILD_FUZZERS=ON \ -DBOOST_BEAST_FUZZER_CORPUS_PATH=${{ github.workspace }}/corpus.tar .. make boost_beast_fuzz_all diff --git a/CMakeLists.txt b/CMakeLists.txt index 034f770867..850f4689a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,48 +1,8 @@ -if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - -# Generated by `boostdep --cmake beast` -# Copyright 2020, 2021 Peter Dimov -# Distributed under the Boost Software License, Version 1.0. -# https://www.boost.org/LICENSE_1_0.txt - -cmake_minimum_required(VERSION 3.8...3.20) - -project(boost_beast VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) - -add_library(boost_beast INTERFACE) -add_library(Boost::beast ALIAS boost_beast) - -target_include_directories(boost_beast INTERFACE include) - -target_link_libraries(boost_beast - INTERFACE - Boost::asio - Boost::assert - Boost::bind - Boost::config - Boost::container - Boost::core - Boost::endian - Boost::intrusive - Boost::logic - Boost::mp11 - Boost::optional - Boost::smart_ptr - Boost::static_assert - Boost::static_string - Boost::system - Boost::throw_exception - Boost::type_traits - Boost::utility - Boost::winapi -) - -target_compile_features(boost_beast INTERFACE cxx_std_11) - -else() - # -# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) +# Copyright (c) 2021 DMitry Arkhipov (grisumbras@gmail.com) +# Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -50,254 +10,164 @@ else() # Official repository: https://github.com/boostorg/beast # -cmake_minimum_required (VERSION 3.5.1) - -if (POLICY CMP0074) - cmake_policy (SET CMP0074 NEW) -endif() - -#------------------------------------------------------------------------------- - -function (DoGroupSources curdir rootdir folder) - file (GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*) - foreach (child ${children}) - if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - DoGroupSources (${curdir}/${child} ${rootdir} ${folder}) - elseif (${child} STREQUAL "CMakeLists.txt") - source_group("" FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - else() - string (REGEX REPLACE ^${rootdir} ${folder} groupname ${curdir}) - string (REPLACE "/" "\\" groupname ${groupname}) - source_group (${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child}) - endif() - endforeach() -endfunction() - -function (GroupSources curdir folder) - DoGroupSources (${curdir} ${curdir} ${folder}) -endfunction() - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Beast +# Project # -#------------------------------------------------------------------------------- - -project (Beast VERSION 356) - -set_property (GLOBAL PROPERTY USE_FOLDERS ON) -option (Beast_BUILD_EXAMPLES "Build examples" ON) -option (Beast_BUILD_TESTS "Build tests" ${BUILD_TESTING}) -option (Beast_BUILD_FUZZERS "Build fuzzers" OFF) -option (Beast_ENABLE_HANDLER_TRACKING "Define BOOST_ASIO_ENABLE_HANDLER_TRACKING when building libraries" OFF) -option (Boost_USE_STATIC_LIBS "Use Static Boost libraries" ON) - -if (MSVC) - set (CMAKE_VERBOSE_MAKEFILE FALSE) - - add_definitions ( - -D_WIN32_WINNT=0x0601 - -D_SCL_SECURE_NO_WARNINGS=1 - -D_CRT_SECURE_NO_WARNINGS=1 - -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING - -D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING - ) - - add_compile_options( - /bigobj # large object file format - /permissive- # strict C++ - #/wd4503 # decorated name length exceeded, name was truncated - /W4 # enable all warnings - /MP # Multi-processor compilation +#------------------------------------------------- +cmake_minimum_required(VERSION 3.8...3.20) +set(BOOST_BEAST_VERSION 356) +if (BOOST_SUPERPROJECT_VERSION) + set(BOOST_BEAST_VERSION ${BOOST_SUPERPROJECT_VERSION}) +endif () +project(boost_beast VERSION "${BOOST_BEAST_VERSION}" LANGUAGES CXX) +set(BOOST_BEAST_IS_ROOT OFF) +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(BOOST_BEAST_IS_ROOT ON) +endif () +set(__ignore__ ${CMAKE_C_COMPILER}) + +#------------------------------------------------- +# +# Options +# +#------------------------------------------------- +if (BOOST_BEAST_IS_ROOT) + include(CTest) +endif () +option(BOOST_BEAST_BUILD_TESTS "Build boost::beast tests" ${BUILD_TESTING}) +option(BOOST_BEAST_BUILD_FUZZERS "Build boost::beast fuzzers" OFF) +option(BOOST_BEAST_BUILD_EXAMPLES "Build boost::beast examples" ${BOOST_BEAST_IS_ROOT}) +option(BOOST_BEAST_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) + +# Check if environment variable BOOST_SRC_DIR is set +if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR}) + set(DEFAULT_BOOST_SRC_DIR "$ENV{BOOST_SRC_DIR}") +else () + set(DEFAULT_BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") +endif () +set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use when running CMake from this directory") + +#------------------------------------------------- +# +# Boost modules +# +#------------------------------------------------- +# The boost super-project requires one explicit dependency per-line. +set(BOOST_BEAST_DEPENDENCIES + Boost::asio + Boost::assert + Boost::bind + Boost::config + Boost::container + Boost::container_hash + Boost::core + Boost::endian + Boost::intrusive + Boost::logic + Boost::mp11 + Boost::optional + Boost::preprocessor + Boost::smart_ptr + Boost::static_assert + Boost::static_string + Boost::system + Boost::throw_exception + Boost::type_index + Boost::type_traits + Boost::winapi ) - - set (Boost_USE_STATIC_RUNTIME ON) - - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ob2 /Oi /Ot /GL /MT") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi /Ot /MT") - - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") - - # for RelWithDebInfo builds, disable incremental linking - # since CMake sets it ON by default for that build type and it - # causes warnings - # - string (REPLACE "/INCREMENTAL" "/INCREMENTAL:NO" replacement_flags - ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}) - set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO ${replacement_flags}) - -else() - set (THREADS_PREFER_PTHREAD_FLAG ON) - find_package (Threads) - link_libraries(Threads::Threads) - - - set( CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wpedantic -Wno-unused-parameter") - - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wrange-loop-analysis") +foreach (BOOST_BEAST_DEPENDENCY ${BOOST_BEAST_DEPENDENCIES}) + if (BOOST_BEAST_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$") + list(APPEND BOOST_BEAST_INCLUDE_LIBRARIES ${CMAKE_MATCH_1}) endif () -endif() - -# Must come before Boost includes, otherwise the -# IDE sees the wrong file due to boost/ symlinks. -include_directories (include) - -#------------------------------------------------------------------------------- +endforeach () +# Conditional dependencies +if (BOOST_BEAST_BUILD_TESTS) + set(BOOST_BEAST_UNIT_TEST_LIBRARIES filesystem) +endif () +if (BOOST_BEAST_BUILD_EXAMPLES) + set(BOOST_BEAST_EXAMPLE_LIBRARIES scope json) +endif () +# Complete dependency list +set(BOOST_INCLUDE_LIBRARIES ${BOOST_BEAST_INCLUDE_LIBRARIES} ${BOOST_BEAST_UNIT_TEST_LIBRARIES} ${BOOST_BEAST_EXAMPLE_LIBRARIES}) +set(BOOST_EXCLUDE_LIBRARIES beast) + +#------------------------------------------------- # -# OpenSSL +# Add Boost Subdirectory # -#------------------------------------------------------------------------------- - -if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR}) - find_program(HOMEBREW brew) - if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND") - execute_process(COMMAND brew --prefix openssl - OUTPUT_VARIABLE OPENSSL_ROOT_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() -endif() +#------------------------------------------------- +if (BOOST_BEAST_IS_ROOT) + set(CMAKE_FOLDER Dependencies) + # Find absolute BOOST_SRC_DIR + if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR}) + set(BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_SRC_DIR}") + endif () -find_package(OpenSSL) -if (NOT MSVC) - link_libraries(${OPENSSL_LIBRARIES}) -endif() + # Validate BOOST_SRC_DIR + set(BOOST_SRC_DIR_IS_VALID ON) + foreach (F "CMakeLists.txt" "Jamroot" "boost-build.jam" "bootstrap.sh" "libs") + if (NOT EXISTS "${BOOST_SRC_DIR}/${F}") + message(STATUS "${BOOST_SRC_DIR}/${F} does not exist. Fallback to find_package.") + set(BOOST_SRC_DIR_IS_VALID OFF) + break() + endif () + endforeach () + + # Create Boost interface targets + if (BOOST_SRC_DIR_IS_VALID) + # From BOOST_SRC_DIR + if (BUILD_SHARED_LIBS) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + endif () + set(BOOST_EXCLUDE_LIBRARIES ${PROJECT_NAME}) + set(PREV_BUILD_TESTING ${BUILD_TESTING}) + set(BUILD_TESTING OFF CACHE BOOL "Build the tests." FORCE) + add_subdirectory(${BOOST_SRC_DIR} Dependencies/boost EXCLUDE_FROM_ALL) + set(BUILD_TESTING ${PREV_BUILD_TESTING} CACHE BOOL "Build the tests." FORCE) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BOOST_SRC_DIR}/tools/cmake/include") + else () + # From Boost Package + find_package(Boost REQUIRED COMPONENTS filesystem scope json) + foreach (BOOST_INCLUDE_LIBRARY ${BOOST_INCLUDE_LIBRARIES}) + if (NOT TARGET Boost::${BOOST_INCLUDE_LIBRARY}) + add_library(Boost::${BOOST_INCLUDE_LIBRARY} ALIAS Boost::headers) + endif () + endforeach () + endif () + unset(CMAKE_FOLDER) +endif () -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Boost +# Library # -#------------------------------------------------------------------------------- - -get_filename_component (BOOST_ROOT ../../ ABSOLUTE) - -# VFALCO I want static but "b2 stage" builds a minimal set which excludes static -add_definitions (-DBOOST_ALL_STATIC_LINK=1) - -add_definitions (-DBOOST_ASIO_NO_DEPRECATED=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_ARRAY=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_BIND=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_DATE_TIME=1) -add_definitions (-DBOOST_ASIO_DISABLE_BOOST_REGEX=1) -add_definitions (-DBOOST_COROUTINES_NO_DEPRECATION_WARNING=1) - -if (MSVC) - include_directories (${BOOST_ROOT}) - link_libraries( bcrypt.lib ) -else() - set(BOOST_INCLUDEDIR ${BOOST_ROOT}) - set(BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib) - find_package(Boost COMPONENTS context filesystem system thread REQUIRED) - link_libraries(Boost::context Boost::filesystem Boost::system Boost::thread) -endif() - -link_directories(${BOOST_ROOT}/stage/lib) - -if (MINGW) - link_libraries(ws2_32 mswsock) -endif() - -#------------------------------------------------------------------------------- - -if ("${VARIANT}" STREQUAL "coverage") - if (MSVC) - else() - set (CMAKE_BUILD_TYPE DEBUG) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 --coverage") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") - endif() - -elseif ("${VARIANT}" STREQUAL "ubasan") - if (MSVC) - else() - set (CMAKE_BUILD_TYPE RELWITHDEBINFO) - set (CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -DBOOST_BEAST_NO_SLOW_TESTS=1 -msse4.2 -funsigned-char -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tools/blacklist.supp") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined -fno-sanitize-recover=address,undefined") - endif() - -elseif ("${VARIANT}" STREQUAL "debug") - set (CMAKE_BUILD_TYPE DEBUG) - -elseif ("${VARIANT}" STREQUAL "release") - set (CMAKE_BUILD_TYPE RELEASE) - -endif() +#------------------------------------------------- +add_library(boost_beast INTERFACE) +add_library(Boost::beast ALIAS boost_beast) +target_include_directories(boost_beast INTERFACE include) +target_link_libraries(boost_beast INTERFACE ${BOOST_BEAST_DEPENDENCIES}) +target_compile_features(boost_beast INTERFACE cxx_std_11) +file(GLOB_RECURSE BOOST_BEAST_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_BEAST_HEADERS}) +target_sources(boost_beast PRIVATE ${BOOST_BEAST_HEADERS} build.jam) -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Static Libraries +# Tests # -#------------------------------------------------------------------------------- - -add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION=1) -add_definitions (-DBOOST_BEAST_SEPARATE_COMPILATION=1) - -GroupSources (test "/") - -add_library ( - lib-asio STATIC - test/lib_asio.cpp -) -if(Beast_ENABLE_HANDLER_TRACKING) - target_compile_definitions(lib-asio - PUBLIC BOOST_ASIO_ENABLE_HANDLER_TRACKING=1) -endif() - -set_property(TARGET lib-asio PROPERTY FOLDER "static-libs") - -add_library ( - lib-asio-ssl STATIC - test/lib_asio_ssl.cpp -) - -set_property(TARGET lib-asio-ssl PROPERTY FOLDER "static-libs") - -add_library ( - lib-beast STATIC - test/lib_beast.cpp -) - -set_property(TARGET lib-beast PROPERTY FOLDER "static-libs") +#------------------------------------------------- +if (BOOST_BEAST_BUILD_TESTS) + add_subdirectory(test) +endif () -target_link_libraries(lib-beast lib-asio) - -#------------------------------------------------------------------------------- +#------------------------------------------------- # -# Tests and examples +# Examples # - -include_directories (.) - -if (OPENSSL_FOUND) - include_directories (${OPENSSL_INCLUDE_DIR}) -endif() - -file (GLOB_RECURSE BOOST_BEAST_FILES - ${PROJECT_SOURCE_DIR}/include/boost/beast/*.hpp - ${PROJECT_SOURCE_DIR}/include/boost/beast/*.ipp -) - -file (GLOB_RECURSE BOOST_BEAST_EXPERIMENTAL_FILES - ${PROJECT_SOURCE_DIR}/include/boost/beast/_experimental/*.hpp - ${PROJECT_SOURCE_DIR}/include/boost/beast/_experimental/*.ipp -) - -file (GLOB_RECURSE COMMON_FILES - ${PROJECT_SOURCE_DIR}/example/common/*.hpp - ) - -if (Beast_BUILD_EXAMPLES AND - (NOT "${VARIANT}" STREQUAL "coverage") AND - (NOT "${VARIANT}" STREQUAL "ubasan")) - add_subdirectory (example) -endif() - -if (Beast_BUILD_TESTS) - add_subdirectory (test) -endif() - -endif() +#------------------------------------------------- +if (BOOST_BEAST_BUILD_EXAMPLES) + add_subdirectory(example) +endif () diff --git a/README.md b/README.md index ae5b7838a1..99311bdc5f 100644 --- a/README.md +++ b/README.md @@ -198,11 +198,9 @@ CMake may be used to generate a very nice Visual Studio solution and a set of Visual Studio project files using these commands: ``` -cd libs/beast -mkdir bin -cd bin -cmake -G "Visual Studio 17 2022" -A Win32 .. # for 32-bit Windows builds, or -cmake -G "Visual Studio 17 2022" -A x64 .. # for 64-bit Windows builds +cmake -G "Visual Studio 17 2022" -A win32 -B bin -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/boost/libs/beast/cmake/toolchains/msvc.cmake" + +cmake -G "Visual Studio 17 2022" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/boost/libs/beast/cmake/toolchains/msvc.cmake" ``` The files in the repository are laid out thusly: diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9441da2ce9..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2016 Peter Dimov -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -version: 1.0.{build}-{branch} -#version: "{branch} (#{build})" - -shallow_clone: true - -platform: - #- x86 - - x64 - -configuration: - #- Debug - - Release - -environment: - OPENSSL_ROOT: C:\tools\vcpkg\installed\x64-windows - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLSET: msvc-14.0 - -# VFALCO Appveyor has a 1 hour time limit, and -# I already test this configuration locally. -# -# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 -# TOOLSET: msvc-14.1 - -# This configuration is not available yet -# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 -# TOOLSET: msvc-14.2 - -install: - - SET BOOST_BRANCH=develop - - IF "%APPVEYOR_REPO_BRANCH%" == "master" SET BOOST_BRANCH=master - - vcpkg install openssl --triplet x64-windows - - ps: cp tools\user-config.jam ~\user-config.jam - - CD .. - - bash -c '$APPVEYOR_BUILD_FOLDER/tools/get-boost.sh $APPVEYOR_REPO_BRANCH $APPVEYOR_BUILD_FOLDER' - - CD boost-root - - CMD /c bootstrap - - b2 headers - -build: off - -test_script: - - b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 libs/beast/example -j3 - - b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 --verbose-test libs/beast/test//run-fat-tests -j3 - - b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 libs/beast/example -j3 - - b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 --verbose-test libs/beast/test//run-fat-tests -j3 - -cache: -- c:\tools\vcpkg\installed\ diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 840acaf508..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,355 +0,0 @@ -variables: - GIT_BRANCH: $(Build.SourceBranch) - -jobs: - - job: 'LinuxCoverage' - pool: - vmImage: 'ubuntu-16.04' - container: - image: djarek/boost-beast-ci:latest - options: --privileged - steps: - - bash: | - sudo apt update && sudo apt install -y g++ lcov - displayName: Get dependencies - - bash: | - set -e - export BUILD_DIR=$(pwd) - cd .. - $BUILD_DIR/tools/get-boost.sh $GIT_BRANCH $BUILD_DIR - cd boost-root - export CXX=g++ CC=gcc - ./bootstrap.sh || cat bootstrap.log - displayName: Get Boost - - bash: | - set -e - cd ../boost-root - ./b2 libs/beast/test//run-fat-tests toolset=gcc coverage=on link=static cxxstd=11 -j2 - libs/beast/tools/coverage.sh - env: - CODECOV_TOKEN: $(CODECOV_TOKEN) - displayName: Build & Run tests - - job: 'Linux' - pool: - vmImage: 'ubuntu-16.04' - container: - image: djarek/boost-beast-ci:latest - options: --privileged - strategy: - matrix: - GCC 9 C++17 Release: - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - VARIANT: release - CXXSTD: 17 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - GCC 9 C++11 HEADER_ONLY NO_DEPRECATED: - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - VARIANT: release - B2_FLAGS: off off - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 9 C++11 NO_DEPRECATED NO_TLS: - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - VARIANT: release - B2_FLAGS: off BOOST_NO_CXX11_THREAD_LOCAL - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 9 C++11 UBASAN: - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - VARIANT: debug - B2_FLAGS: norecover norecover - # use GOLD to workaround UBSAN linker issue in gcc 7/8 - # https://stackoverflow.com/questions/50024731/ld-unrecognized-option-push-state-no-as-needed - CXX_FLAGS: "-msse4.2 -funsigned-char -fno-omit-frame-pointer" -fuse-ld=gold - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 9 C++11 TSAN: - TOOLSET: gcc - CXX: g++-9 - PACKAGES: g++-9 - VARIANT: release - B2_FLAGS: norecover - CXX_FLAGS: "-msse4.2 -funsigned-char -fno-omit-frame-pointer" - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 8 C++17 Release: - TOOLSET: gcc - CXX: g++-8 - PACKAGES: g++-8 - VARIANT: release - CXXSTD: 17 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - GCC 8 C++11 HEADER_ONLY NO_DEPRECATED: - TOOLSET: gcc - CXX: g++-8 - PACKAGES: g++-8 - VARIANT: release - B2_FLAGS: off off - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 8 C++11 UBASAN: - TOOLSET: gcc - CXX: g++-8 - PACKAGES: g++-8 - VARIANT: debug - B2_FLAGS: norecover norecover - # use GOLD to workaround UBSAN linker issue in gcc 7/8 - # https://stackoverflow.com/questions/50024731/ld-unrecognized-option-push-state-no-as-needed - CXX_FLAGS: "-msse4.2 -funsigned-char -fno-omit-frame-pointer" -fuse-ld=gold - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 8 C++11 TSAN: - TOOLSET: gcc - CXX: g++-8 - PACKAGES: g++-8 - VARIANT: release - B2_FLAGS: norecover - CXX_FLAGS: "-msse4.2 -funsigned-char -fno-omit-frame-pointer" - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC 7 C++14 Valgrind: - TOOLSET: gcc - CXX: g++-7 - PACKAGES: g++-7 valgrind - VARIANT: release - B2_FLAGS: BOOST_BEAST_TEST_STATIC_PRNG_SEED on "valgrind --track-origins=yes --error-exitcode=1 --max-stackframe=16000000 --suppressions=libs/beast/tools/valgrind.supp" - CXXSTD: 14 - B2_TARGETS: libs/beast/test//run-fat-tests - GCC Default C++11 Release: - TOOLSET: gcc - CXX: g++ - PACKAGES: g++ - VARIANT: release - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - Clang 6.0 C++11 Debug: - TOOLSET: clang - CXX: clang++-6.0 - PACKAGES: clang-6.0 - VARIANT: debug - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - Clang 7 libc++ C++14 Valgrind: - TOOLSET: clang - CXX: clang++-7 - PACKAGES: clang-7 libc++-7-dev libc++abi-7-dev valgrind - VARIANT: release - B2_FLAGS: on "valgrind --track-origins=yes --error-exitcode=1 --max-stackframe=16000000 --suppressions=libs/beast/tools/valgrind.supp" - CXXSTD: 14 - CXX_FLAGS: "-stdlib=libc++" "-stdlib=libc++" - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 7 C++11 Debug: - TOOLSET: clang - CXX: clang++-7 - PACKAGES: clang-7 - VARIANT: debug - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - Clang 7 C++14 Release: - TOOLSET: clang - CXX: clang++-7 - PACKAGES: clang-7 - VARIANT: release - CXXSTD: 14 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - Clang Default C++11 Debug: - TOOLSET: clang - CXX: clang++ - PACKAGES: clang - VARIANT: debug - CXXSTD: 11 - B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example - Clang 8 libc++ C++14 UBASAN: - TOOLSET: clang - CXX: clang++-8 - PACKAGES: clang-8 libc++-8-dev libc++abi-8-dev - VARIANT: release - B2_FLAGS: norecover norecover - UBSAN_OPTIONS: print_stacktrace=1 - CXXSTD: 14 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 8 libc++ C++14 TSAN: - TOOLSET: clang - CXX: clang++-8 - PACKAGES: clang-8 libc++-8-dev libc++abi-8-dev - VARIANT: release - B2_FLAGS: norecover - CXXSTD: 14 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 9 libc++ C++14 Release HEADER_ONLY NO_DEPRECATED: - TOOLSET: clang - CXX: clang++-9 - PACKAGES: clang-9 libc++-9-dev libc++abi-9-dev - VARIANT: release - B2_FLAGS: off off - CXXSTD: 14 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 9 libc++ C++17 UBASAN: - TOOLSET: clang - CXX: clang++-9 - PACKAGES: clang-9 libc++-9-dev libc++abi-9-dev - VARIANT: release - B2_FLAGS: norecover norecover - UBSAN_OPTIONS: print_stacktrace=1 - CXXSTD: 17 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 9 libc++ C++17 TSAN: - TOOLSET: clang - CXX: clang++-9 - PACKAGES: clang-9 libc++-9-dev libc++abi-9-dev - VARIANT: release - B2_FLAGS: norecover - CXXSTD: 17 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - Clang 9 libc++ C++11 Release HEADER_ONLY NO_DEPRECATED: - TOOLSET: clang - CXX: clang++-9 - PACKAGES: clang-9 libc++-9-dev libc++abi-9-dev - VARIANT: release - B2_FLAGS: off off - CXXSTD: 11 - CXX_FLAGS: "-stdlib=libc++ -msse4.2 -funsigned-char -fno-omit-frame-pointer" -stdlib=libc++ - B2_TARGETS: libs/beast/test//run-fat-tests - steps: - - bash: | - sudo apt update && sudo apt install -y $PACKAGES - displayName: Get dependencies - - bash: | - set -e - export BUILD_DIR=$(pwd) - cd .. - $BUILD_DIR/tools/get-boost.sh $GIT_BRANCH $BUILD_DIR - cd boost-root - ./bootstrap.sh || cat bootstrap.log - cp libs/beast/tools/user-config.jam ~/user-config.jam - echo "using $TOOLSET : : $(which $CXX) : $CXX_FLAGS ;" >> ~/user-config.jam - echo "project : requirements $B2_FLAGS ;" >> ~/user-config.jam - displayName: Get Boost - - bash: | - set -e - cd ../boost-root - echo "B2_FLAGS: $B2_FLAGS" - ./b2 -j2 \ - --debug-configuration \ - cxxstd=$CXXSTD \ - toolset=$TOOLSET \ - variant=$VARIANT \ - $B2_TARGETS - displayName: Build & Run tests - - - job: 'macOS' - pool: - vmImage: 'macOS-10.13' - strategy: - matrix: - Xcode 10.1 C++17 Release: - TOOLSET: clang - VARIANT: release - CXXSTD: 17 - XCODE_APP: /Applications/Xcode_10.1.app - Xcode 9.4.1 C++11 Release: - TOOLSET: clang - VARIANT: release - CXXSTD: 11 - XCODE_APP: /Applications/Xcode_9.4.1.app - steps: - - bash: | - brew install openssl - displayName: Get OpenSSL - - bash: | - set -e - sudo xcode-select -switch ${XCODE_APP} - which clang++ - export BUILD_DIR=$(pwd) - cd .. - $BUILD_DIR/tools/get-boost.sh $GIT_BRANCH $BUILD_DIR - cd boost-root - ./bootstrap.sh || cat bootstrap.log - cp libs/beast/tools/user-config.jam ~/user-config.jam - displayName: Get Boost - - bash: | - set -e - export OPENSSL_ROOT=$(brew --prefix openssl) - cd ../boost-root - ./b2 -j2 \ - --debug-configuration \ - define=BOOST_COROUTINES_NO_DEPRECATION_WARNING=1 \ - cxxstd=$CXXSTD \ - libs/beast/test//run-fat-tests \ - libs/beast/example \ - toolset=$TOOLSET \ - variant=$VARIANT - displayName: Build & Run tests - - - job: 'Windows' - strategy: - matrix: - # MSVC14.2: # FIXME(djarek): windows-2019 doesn't have vcpkg - MSVC14.2 C++17 x64: - VM_IMAGE: 'windows-2019' - TOOLSET: msvc-14.2 - CXXSTD: 17 - ADDRMODEL: 64 - MSVC14.1 C++17 x64: - VM_IMAGE: 'vs2017-win2016' - TOOLSET: msvc-14.1 - CXXSTD: 17 - ADDRMODEL: 64 - MSVC14.0 C++11 x64: - VM_IMAGE: 'vs2017-win2016' - TOOLSET: msvc-14.0 - CXXSTD: 11 - ADDRMODEL: 64 - pool: - vmImage: $(VM_IMAGE) - steps: - - bash: | - vcpkg install openssl --triplet "x$ADDRMODEL""-windows" - displayName: Get OpenSSL - - - bash: | - set -e - export BUILD_DIR=$(pwd) - cd .. - $BUILD_DIR/tools/get-boost.sh $GIT_BRANCH $BUILD_DIR - cd boost-root - ./bootstrap.sh - cp libs/beast/tools/user-config.jam ~/user-config.jam - displayName: Get Boost - - - bash: | - set -e - echo "VCPKG_ROOT: $VCPKG_INSTALLATION_ROOT" - export OPENSSL_ROOT="$VCPKG_INSTALLATION_ROOT""/installed/x$ADDRMODEL""-windows" - cd ../boost-root - ./b2 -j2 \ - --debug-configuration \ - variant=debug \ - cxxstd=$CXXSTD \ - address-model=$ADDRMODEL \ - toolset=$TOOLSET \ - $B2_FLAGS \ - libs/beast/example - ./b2 -j2 \ - --debug-configuration \ - variant=debug,release \ - cxxstd=$CXXSTD \ - address-model=$ADDRMODEL \ - toolset=$TOOLSET \ - $B2_FLAGS \ - --verbose-test \ - libs/beast/test//run-fat-tests - displayName: Build & Run tests diff --git a/cmake/toolchains/clang.cmake b/cmake/toolchains/clang.cmake new file mode 100644 index 0000000000..72dfd3e9cf --- /dev/null +++ b/cmake/toolchains/clang.cmake @@ -0,0 +1,5 @@ +# Include gcc options. +include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake) + +# Compiler options. +add_compile_options(-Wrange-loop-analysis) diff --git a/cmake/toolchains/common.cmake b/cmake/toolchains/common.cmake new file mode 100644 index 0000000000..9628d30c1b --- /dev/null +++ b/cmake/toolchains/common.cmake @@ -0,0 +1,18 @@ +# C++ standard. +set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "") + +# Static library linkage. +set(BUILD_SHARED_LIBS OFF CACHE STRING "") +add_definitions(-DBOOST_ALL_STATIC_LINK=1) + +# Interprocedural optimization. +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "") +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "") +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "") + +# Compiler definitions. +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS) +endif() + +# Project options. diff --git a/cmake/toolchains/gcc.cmake b/cmake/toolchains/gcc.cmake new file mode 100644 index 0000000000..b6a8e1d039 --- /dev/null +++ b/cmake/toolchains/gcc.cmake @@ -0,0 +1,5 @@ +# Include common options. +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +# Compiler options. +add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter) diff --git a/cmake/toolchains/msvc.cmake b/cmake/toolchains/msvc.cmake new file mode 100644 index 0000000000..0e6cb581c1 --- /dev/null +++ b/cmake/toolchains/msvc.cmake @@ -0,0 +1,35 @@ +# Include common options. +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +# Static runtime linkage. +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "") + +# Compiler options. +# Specific to C and CXX, to prevent passing them to MASM +add_compile_options( + $<$:/bigobj> + $<$:/permissive-> + $<$:/W4> + $<$:/MP> +) +if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") # 32-bit + add_compile_options( + /arch:SSE2 + ) +endif() + +# Linker options. +add_link_options( +) + +# Disable logos. +foreach(lang C CXX ASM_MASM RC) + set(CMAKE_${lang}_FLAGS_INIT "/nologo") +endforeach() +foreach(type EXE SHARED MODULE) + set(CMAKE_${type}_LINKER_FLAGS_INIT "/nologo") +endforeach() + +# Silence Visual Studio CMake integration warnings. +set(SILENCE_VS_DEFINITIONS ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_C_COMPILER}) +set(SILENCE_VS_DEFINITIONS) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 950c29db9b..8979f2647b 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -7,8 +7,10 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (advanced) -add_subdirectory (http) -add_subdirectory (websocket) +find_package(OpenSSL) -add_subdirectory (echo-op) +add_subdirectory(advanced) +add_subdirectory(http) +add_subdirectory(websocket) + +add_subdirectory(echo-op) diff --git a/example/advanced/CMakeLists.txt b/example/advanced/CMakeLists.txt index 902020bb60..3b6e54cc9a 100644 --- a/example/advanced/CMakeLists.txt +++ b/example/advanced/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +8,9 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (server) -add_subdirectory (server-flex) -add_subdirectory (server-flex-awaitable) +add_subdirectory(server) + +if (OPENSSL_FOUND) + add_subdirectory(server-flex) + add_subdirectory(server-flex-awaitable) +endif () diff --git a/example/advanced/server-flex-awaitable/CMakeLists.txt b/example/advanced/server-flex-awaitable/CMakeLists.txt index 0ebee130a8..0090f6011d 100644 --- a/example/advanced/server-flex-awaitable/CMakeLists.txt +++ b/example/advanced/server-flex-awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/advanced/server-flex-awaitable "/") +add_executable(advanced-server-flex-awaitable + Jamfile + advanced_server_flex_awaitable.cpp) - add_executable (advanced-server-flex-awaitable - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - advanced_server_flex_awaitable.cpp - ) +source_group("" FILES + Jamfile + advanced_server_flex_awaitable.cpp) - set_property(TARGET advanced-server-flex-awaitable PROPERTY FOLDER "example-advanced-server") - - target_link_libraries (advanced-server-flex-awaitable - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_include_directories(advanced-server-flex-awaitable + PRIVATE ${PROJECT_SOURCE_DIR}) -endif() +target_link_libraries(advanced-server-flex-awaitable + PRIVATE Boost::beast Boost::scope OpenSSL::SSL OpenSSL::Crypto) + +set_target_properties(advanced-server-flex-awaitable + PROPERTIES FOLDER "example-advanced-server") diff --git a/example/advanced/server-flex/CMakeLists.txt b/example/advanced/server-flex/CMakeLists.txt index d6075b277a..9bd2363f45 100644 --- a/example/advanced/server-flex/CMakeLists.txt +++ b/example/advanced/server-flex/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/advanced/server-flex "/") +add_executable(advanced-server-flex + Jamfile + advanced_server_flex.cpp) - add_executable (advanced-server-flex - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - advanced_server_flex.cpp - ) +source_group("" FILES + Jamfile + advanced_server_flex.cpp) - set_property(TARGET advanced-server-flex PROPERTY FOLDER "example-advanced-server") - - target_link_libraries (advanced-server-flex - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_include_directories(advanced-server-flex + PRIVATE ${PROJECT_SOURCE_DIR}) -endif() +target_link_libraries(advanced-server-flex + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) + +set_target_properties(advanced-server-flex + PROPERTIES FOLDER "example-advanced-server") diff --git a/example/advanced/server/CMakeLists.txt b/example/advanced/server/CMakeLists.txt index 08014afee1..715b4831d3 100644 --- a/example/advanced/server/CMakeLists.txt +++ b/example/advanced/server/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,14 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/advanced/server "/") +add_executable(advanced-server + Jamfile + advanced_server.cpp) -add_executable (advanced-server - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - advanced_server.cpp -) + advanced_server.cpp) -target_link_libraries(advanced-server - lib-asio - lib-beast) +target_link_libraries(advanced-server PRIVATE Boost::beast) -set_property(TARGET advanced-server PROPERTY FOLDER "example-advanced-server") +set_target_properties(advanced-server PROPERTIES FOLDER "example-advanced-server") diff --git a/example/echo-op/CMakeLists.txt b/example/echo-op/CMakeLists.txt index d0e086b6e6..7bece942bc 100644 --- a/example/echo-op/CMakeLists.txt +++ b/example/echo-op/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/echo-op "/") +add_executable(echo-op + Jamfile + echo_op.cpp) -add_executable (echo-op - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - echo_op.cpp -) + echo_op.cpp) -target_link_libraries(echo-op - lib-asio - lib-beast) +target_link_libraries(echo-op PRIVATE Boost::beast) -set_property(TARGET echo-op PROPERTY FOLDER "example") +set_target_properties(echo-op + PROPERTIES FOLDER "example-echo-op") diff --git a/example/http/CMakeLists.txt b/example/http/CMakeLists.txt index d38604dd0f..e057d48bc3 100644 --- a/example/http/CMakeLists.txt +++ b/example/http/CMakeLists.txt @@ -7,5 +7,5 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (client) -add_subdirectory (server) +add_subdirectory(client) +add_subdirectory(server) diff --git a/example/http/client/CMakeLists.txt b/example/http/client/CMakeLists.txt index e052a9b392..ab8fa1876d 100644 --- a/example/http/client/CMakeLists.txt +++ b/example/http/client/CMakeLists.txt @@ -7,19 +7,18 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (crawl) -add_subdirectory (sync) -add_subdirectory (body) -add_subdirectory (methods) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(body) +add_subdirectory(coro) +add_subdirectory(crawl) +add_subdirectory(methods) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (async-ssl-system-executor) - add_subdirectory (awaitable-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (sync-ssl) -endif() - + add_subdirectory(async-ssl) + add_subdirectory(async-ssl-system-executor) + add_subdirectory(awaitable-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/http/client/async-ssl-system-executor/CMakeLists.txt b/example/http/client/async-ssl-system-executor/CMakeLists.txt index 049a2fea9a..ef193a77b3 100644 --- a/example/http/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/http/client/async-ssl-system-executor/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/async-ssl-system-executor "/") +add_executable(http-client-async-ssl-system-executor + Jamfile + http_client_async_ssl_system_executor.cpp) - add_executable (http-client-async-ssl-system-executor - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_async_ssl_system_executor.cpp - ) +source_group("" FILES + Jamfile + http_client_async_ssl_system_executor.cpp) - set_property(TARGET http-client-async-ssl-system-executor PROPERTY FOLDER "example-http-client") +target_include_directories(http-client-async-ssl-system-executor + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-client-async-ssl-system-executor - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-client-async-ssl-system-executor + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-client-async-ssl-system-executor + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/async-ssl/CMakeLists.txt b/example/http/client/async-ssl/CMakeLists.txt index a64fbf6185..0f5cc2b116 100644 --- a/example/http/client/async-ssl/CMakeLists.txt +++ b/example/http/client/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/async-ssl "/") +add_executable(http-client-async-ssl + Jamfile + http_client_async_ssl.cpp) - add_executable (http-client-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_async_ssl.cpp - ) +source_group("" FILES + Jamfile + http_client_async_ssl.cpp) - set_property(TARGET http-client-async-ssl PROPERTY FOLDER "example-http-client") +target_include_directories(http-client-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-client-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-client-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-client-async-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/async/CMakeLists.txt b/example/http/client/async/CMakeLists.txt index 3847ce6101..96b9d3fed0 100644 --- a/example/http/client/async/CMakeLists.txt +++ b/example/http/client/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/async "/") +add_executable(http-client-async + Jamfile + http_client_async.cpp) -add_executable (http-client-async - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_async.cpp -) + http_client_async.cpp) -target_link_libraries(http-client-async - lib-asio - lib-beast) +target_link_libraries(http-client-async PRIVATE Boost::beast) -set_property(TARGET http-client-async PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-async + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/awaitable-ssl/CMakeLists.txt b/example/http/client/awaitable-ssl/CMakeLists.txt index fd09f831f0..066cdf5c0e 100644 --- a/example/http/client/awaitable-ssl/CMakeLists.txt +++ b/example/http/client/awaitable-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/awaitable "/") +add_executable(http-client-awaitable-ssl + Jamfile + http_client_awaitable_ssl.cpp) -add_executable (http-client-awaitable-ssl - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_awaitable_ssl.cpp - ) + http_client_awaitable_ssl.cpp) + +target_include_directories(http-client-awaitable-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(http-client-awaitable-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast) + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -set_property(TARGET http-client-awaitable-ssl PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-awaitable-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/awaitable/CMakeLists.txt b/example/http/client/awaitable/CMakeLists.txt index f18d0b94f9..a5a5a9a4ff 100644 --- a/example/http/client/awaitable/CMakeLists.txt +++ b/example/http/client/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/awaitable "/") +add_executable(http-client-awaitable + Jamfile + http_client_awaitable.cpp) -add_executable (http-client-awaitable - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_awaitable.cpp - ) + http_client_awaitable.cpp) -target_link_libraries(http-client-awaitable - lib-asio - lib-beast) +target_link_libraries(http-client-awaitable PRIVATE Boost::beast) -set_property(TARGET http-client-awaitable PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-awaitable + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/body/CMakeLists.txt b/example/http/client/body/CMakeLists.txt index 6709a48679..8481846ff2 100644 --- a/example/http/client/body/CMakeLists.txt +++ b/example/http/client/body/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/coro "/") +add_executable(http-client-json + Jamfile + json_client.cpp) -add_executable (http-client-json - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - json_client.cpp - ) + json_client.cpp) -target_link_libraries(http-client-json - lib-asio - lib-beast) +target_link_libraries(http-client-json PRIVATE Boost::beast Boost::json) -set_property(TARGET http-client-json PROPERTY FOLDER "example-json-client") +set_target_properties(http-client-json + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/coro-ssl/CMakeLists.txt b/example/http/client/coro-ssl/CMakeLists.txt index 54fe3ae25d..5ccc4f7303 100644 --- a/example/http/client/coro-ssl/CMakeLists.txt +++ b/example/http/client/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/coro-ssl "/") +add_executable(http-client-coro-ssl + Jamfile + http_client_coro_ssl.cpp) - add_executable (http-client-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_coro_ssl.cpp - ) +source_group("" FILES + Jamfile + http_client_coro_ssl.cpp) - set_property(TARGET http-client-coro-ssl PROPERTY FOLDER "example-http-client") +target_include_directories(http-client-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-client-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-client-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-client-coro-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/coro/CMakeLists.txt b/example/http/client/coro/CMakeLists.txt index 1a791ab1bb..05e30c3f9e 100644 --- a/example/http/client/coro/CMakeLists.txt +++ b/example/http/client/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/coro "/") +add_executable(http-client-coro + Jamfile + http_client_coro.cpp) -add_executable (http-client-coro - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_coro.cpp - ) + http_client_coro.cpp) -target_link_libraries(http-client-coro - lib-asio - lib-beast) +target_link_libraries(http-client-coro PRIVATE Boost::beast) -set_property(TARGET http-client-coro PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-coro + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/crawl/CMakeLists.txt b/example/http/client/crawl/CMakeLists.txt index b502c7d704..ba342a1bf0 100644 --- a/example/http/client/crawl/CMakeLists.txt +++ b/example/http/client/crawl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,20 +8,17 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/crawl "/") - -add_executable (http-crawl - ${BOOST_BEAST_FILES} +add_executable(http-crawl Jamfile - urls_large_data.hpp - urls_large_data.cpp http_crawl.cpp -) + urls_large_data.cpp) -target_link_libraries(http-crawl - lib-asio - lib-beast) +source_group("" FILES + Jamfile + http_crawl.cpp + urls_large_data.cpp) -set_property(TARGET http-crawl PROPERTY FOLDER "example-http-client") +target_link_libraries(http-crawl PRIVATE Boost::beast) +set_target_properties(http-crawl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/methods/CMakeLists.txt b/example/http/client/methods/CMakeLists.txt index cbd5e51b07..2e9fcdcb3e 100644 --- a/example/http/client/methods/CMakeLists.txt +++ b/example/http/client/methods/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/methods "/") +add_executable(http-client-methods + Jamfile + http_client_methods.cpp) -add_executable (http-client-methods - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_methods.cpp -) + http_client_methods.cpp) -target_link_libraries(http-client-methods - lib-asio - lib-beast) +target_link_libraries(http-client-methods PRIVATE Boost::beast) -set_property(TARGET http-client-methods PROPERTY FOLDER "example-http-client-methods") +set_target_properties(http-client-methods + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/sync-ssl/CMakeLists.txt b/example/http/client/sync-ssl/CMakeLists.txt index 0e0fbea077..42e4d75f17 100644 --- a/example/http/client/sync-ssl/CMakeLists.txt +++ b/example/http/client/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/client/sync-ssl "/") +add_executable(http-client-sync-ssl + Jamfile + http_client_sync_ssl.cpp) - add_executable (http-client-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_sync_ssl.cpp - ) +source_group("" FILES + Jamfile + http_client_sync_ssl.cpp) - set_property(TARGET http-client-sync-ssl PROPERTY FOLDER "example-http-client") +target_include_directories(http-client-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-client-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-client-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-client-sync-ssl + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/client/sync/CMakeLists.txt b/example/http/client/sync/CMakeLists.txt index ea877ec4f0..f1765ef8ac 100644 --- a/example/http/client/sync/CMakeLists.txt +++ b/example/http/client/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/client/sync "/") +add_executable(http-client-sync + Jamfile + http_client_sync.cpp) -add_executable (http-client-sync - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_client_sync.cpp -) + http_client_sync.cpp) -target_link_libraries(http-client-sync - lib-asio - lib-beast) +target_link_libraries(http-client-sync PRIVATE Boost::beast) -set_property(TARGET http-client-sync PROPERTY FOLDER "example-http-client") +set_target_properties(http-client-sync + PROPERTIES FOLDER "example-http-client") diff --git a/example/http/server/CMakeLists.txt b/example/http/server/CMakeLists.txt index 075f866567..90eceb11f0 100644 --- a/example/http/server/CMakeLists.txt +++ b/example/http/server/CMakeLists.txt @@ -7,18 +7,18 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (fast) -add_subdirectory (small) -add_subdirectory (stackless) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(coro) +add_subdirectory(fast) +add_subdirectory(small) +add_subdirectory(stackless) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (flex) - add_subdirectory (stackless-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(flex) + add_subdirectory(stackless-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/http/server/async-ssl/CMakeLists.txt b/example/http/server/async-ssl/CMakeLists.txt index 4c1e2cd025..a225deb7dd 100644 --- a/example/http/server/async-ssl/CMakeLists.txt +++ b/example/http/server/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/async-ssl "/") +add_executable(http-server-async-ssl + Jamfile + http_server_async_ssl.cpp) - add_executable (http-server-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_async_ssl.cpp - ) +source_group("" FILES + Jamfile + http_server_async_ssl.cpp) - set_property(TARGET http-server-async-ssl PROPERTY FOLDER "example-http-server") +target_include_directories(http-server-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-server-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-server-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-server-async-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/async/CMakeLists.txt b/example/http/server/async/CMakeLists.txt index b94c0521fc..c3a13b1c1c 100644 --- a/example/http/server/async/CMakeLists.txt +++ b/example/http/server/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/async "/") +add_executable(http-server-async + Jamfile + http_server_async.cpp) -add_executable (http-server-async - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_async.cpp -) + http_server_async.cpp) -target_link_libraries(http-server-async - lib-asio - lib-asio-ssl - lib-beast) +target_link_libraries(http-server-async PRIVATE Boost::beast) -set_property(TARGET http-server-async PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-async + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/awaitable/CMakeLists.txt b/example/http/server/awaitable/CMakeLists.txt index 3cfc4808e8..ed0aaa79ef 100644 --- a/example/http/server/awaitable/CMakeLists.txt +++ b/example/http/server/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/awaitable "/") +add_executable(http-server-awaitable + Jamfile + http_server_awaitable.cpp) -add_executable (http-server-awaitable - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_awaitable.cpp -) + http_server_awaitable.cpp) -target_link_libraries(http-server-awaitable - lib-asio - lib-beast) +target_link_libraries(http-server-awaitable PRIVATE Boost::beast) -set_property(TARGET http-server-awaitable PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-awaitable + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/coro-ssl/CMakeLists.txt b/example/http/server/coro-ssl/CMakeLists.txt index 9bbf294cff..19846a811b 100644 --- a/example/http/server/coro-ssl/CMakeLists.txt +++ b/example/http/server/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/coro-ssl "/") +add_executable(http-server-coro-ssl + Jamfile + http_server_coro_ssl.cpp) - add_executable (http-server-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_coro_ssl.cpp - ) +source_group("" FILES + Jamfile + http_server_coro_ssl.cpp) - set_property(TARGET http-server-coro-ssl PROPERTY FOLDER "example-http-server") +target_include_directories(http-server-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-server-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-server-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-server-coro-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/coro/CMakeLists.txt b/example/http/server/coro/CMakeLists.txt index 6cc8244a89..c7b24be69b 100644 --- a/example/http/server/coro/CMakeLists.txt +++ b/example/http/server/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/coro "/") +add_executable(http-server-coro + Jamfile + http_server_coro.cpp) -add_executable (http-server-coro - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_coro.cpp -) + http_server_coro.cpp) -target_link_libraries(http-server-coro - lib-asio - lib-beast) +target_link_libraries(http-server-coro PRIVATE Boost::beast) -set_property(TARGET http-server-coro PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-coro + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/fast/CMakeLists.txt b/example/http/server/fast/CMakeLists.txt index ecc8f7bdc8..6c907ae1f6 100644 --- a/example/http/server/fast/CMakeLists.txt +++ b/example/http/server/fast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,20 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/fast "/") +add_executable(http-server-fast + Jamfile + http_server_fast.cpp) -add_executable (http-server-fast - ${BOOST_BEAST_FILES} - ${COMMON_FILES} +source_group("" FILES Jamfile - fields_alloc.hpp - http_server_fast.cpp -) + http_server_fast.cpp) -target_link_libraries(http-server-fast - lib-asio - lib-beast) +target_link_libraries(http-server-fast PRIVATE Boost::beast) -set_property(TARGET http-server-fast PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-fast + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/flex/CMakeLists.txt b/example/http/server/flex/CMakeLists.txt index 0920953b3a..1cc4b489ec 100644 --- a/example/http/server/flex/CMakeLists.txt +++ b/example/http/server/flex/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/flex "/") +add_executable(http-server-flex + Jamfile + http_server_flex.cpp) - add_executable (http-server-flex - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_flex.cpp - ) +source_group("" FILES + Jamfile + http_server_flex.cpp) - set_property(TARGET http-server-flex PROPERTY FOLDER "example-http-server") +target_include_directories(http-server-flex + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-server-flex - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-server-flex + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-server-flex + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/small/CMakeLists.txt b/example/http/server/small/CMakeLists.txt index c443dec5cd..f2dc894428 100644 --- a/example/http/server/small/CMakeLists.txt +++ b/example/http/server/small/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/small "/") +add_executable(http-server-small + Jamfile + http_server_small.cpp) -add_executable (http-server-small - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_small.cpp -) + http_server_small.cpp) -target_link_libraries(http-server-small - lib-asio - lib-beast) +target_link_libraries(http-server-small PRIVATE Boost::beast) -set_property(TARGET http-server-small PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-small + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/stackless-ssl/CMakeLists.txt b/example/http/server/stackless-ssl/CMakeLists.txt index f25b9b3d64..2c4aa2cbcf 100644 --- a/example/http/server/stackless-ssl/CMakeLists.txt +++ b/example/http/server/stackless-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/stackless-ssl "/") +add_executable(http-server-stackless-ssl + Jamfile + http_server_stackless_ssl.cpp) - add_executable (http-server-stackless-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_stackless_ssl.cpp - ) +source_group("" FILES + Jamfile + http_server_stackless_ssl.cpp) - set_property(TARGET http-server-stackless-ssl PROPERTY FOLDER "example-http-server") +target_include_directories(http-server-stackless-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (http-server-stackless-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(http-server-stackless-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(http-server-stackless-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/stackless/CMakeLists.txt b/example/http/server/stackless/CMakeLists.txt index 1f82d391f1..77d7123b51 100644 --- a/example/http/server/stackless/CMakeLists.txt +++ b/example/http/server/stackless/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/stackless "/") +add_executable(http-server-stackless + Jamfile + http_server_stackless.cpp) -add_executable (http-server-stackless - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_stackless.cpp -) + http_server_stackless.cpp) -target_link_libraries(http-server-stackless - lib-asio - lib-beast) +target_link_libraries(http-server-stackless PRIVATE Boost::beast) -set_property(TARGET http-server-stackless PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-stackless + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/sync-ssl/CMakeLists.txt b/example/http/server/sync-ssl/CMakeLists.txt index 4142e2c95f..7d2b2e85c3 100644 --- a/example/http/server/sync-ssl/CMakeLists.txt +++ b/example/http/server/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/http/server/sync-ssl "/") +add_executable(http-server-sync-ssl + Jamfile + http_server_sync_ssl.cpp) - add_executable (http-server-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_sync_ssl.cpp - ) +source_group("" FILES + Jamfile + http_server_sync_ssl.cpp) - set_property(TARGET http-server-sync-ssl PROPERTY FOLDER "example-http-server") - - target_link_libraries (http-server-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_include_directories(http-server-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) -endif() +target_link_libraries(http-server-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) + +set_target_properties(http-server-sync-ssl + PROPERTIES FOLDER "example-http-server") diff --git a/example/http/server/sync/CMakeLists.txt b/example/http/server/sync/CMakeLists.txt index 250add7736..7ba1f08cdd 100644 --- a/example/http/server/sync/CMakeLists.txt +++ b/example/http/server/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/http/server/sync "/") +add_executable(http-server-sync + Jamfile + http_server_sync.cpp) -add_executable (http-server-sync - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - http_server_sync.cpp -) + http_server_sync.cpp) -target_link_libraries(http-server-sync - lib-asio - lib-asio-ssl - lib-beast) +target_link_libraries(http-server-sync PRIVATE Boost::beast) -set_property(TARGET http-server-sync PROPERTY FOLDER "example-http-server") +set_target_properties(http-server-sync + PROPERTIES FOLDER "example-http-server") diff --git a/example/websocket/CMakeLists.txt b/example/websocket/CMakeLists.txt index d38604dd0f..e057d48bc3 100644 --- a/example/websocket/CMakeLists.txt +++ b/example/websocket/CMakeLists.txt @@ -7,5 +7,5 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (client) -add_subdirectory (server) +add_subdirectory(client) +add_subdirectory(server) diff --git a/example/websocket/client/CMakeLists.txt b/example/websocket/client/CMakeLists.txt index 1d09cd03ff..e925af8343 100644 --- a/example/websocket/client/CMakeLists.txt +++ b/example/websocket/client/CMakeLists.txt @@ -7,14 +7,14 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (coro) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(coro) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (async-ssl-system-executor) - add_subdirectory (coro-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(async-ssl-system-executor) + add_subdirectory(coro-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt index 3a22aade81..4f8c9c8f02 100644 --- a/example/websocket/client/async-ssl-system-executor/CMakeLists.txt +++ b/example/websocket/client/async-ssl-system-executor/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/async-ssl-system-executor "/") +add_executable(websocket-client-async-ssl-system-executor + Jamfile + websocket_client_async_ssl_system_executor.cpp) - add_executable (websocket-client-async-ssl-system-executor - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_async_ssl_system_executor.cpp - ) +source_group("" FILES + Jamfile + websocket_client_async_ssl_system_executor.cpp) - set_property(TARGET websocket-client-async-ssl-system-executor PROPERTY FOLDER "example-websocket-client") +target_include_directories(websocket-client-async-ssl-system-executor + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-client-async-ssl-system-executor - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-client-async-ssl-system-executor + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-client-async-ssl-system-executor + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/async-ssl/CMakeLists.txt b/example/websocket/client/async-ssl/CMakeLists.txt index a21982806e..49f5aad927 100644 --- a/example/websocket/client/async-ssl/CMakeLists.txt +++ b/example/websocket/client/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/async-ssl "/") +add_executable(websocket-client-async-ssl + Jamfile + websocket_client_async_ssl.cpp) - add_executable (websocket-client-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_async_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_client_async_ssl.cpp) - set_property(TARGET websocket-client-async-ssl PROPERTY FOLDER "example-websocket-client") +target_include_directories(websocket-client-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-client-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-client-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-client-async-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/async/CMakeLists.txt b/example/websocket/client/async/CMakeLists.txt index cc64340714..2fd98e7e12 100644 --- a/example/websocket/client/async/CMakeLists.txt +++ b/example/websocket/client/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/async "/") +add_executable(websocket-client-async + Jamfile + websocket_client_async.cpp) -add_executable (websocket-client-async - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_client_async.cpp -) + websocket_client_async.cpp) -target_link_libraries(websocket-client-async - lib-asio - lib-beast) +target_link_libraries(websocket-client-async PRIVATE Boost::beast) -set_property(TARGET websocket-client-async PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-async + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/awaitable/CMakeLists.txt b/example/websocket/client/awaitable/CMakeLists.txt index b0929f1684..eeb2971105 100644 --- a/example/websocket/client/awaitable/CMakeLists.txt +++ b/example/websocket/client/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/awaitable "/") +add_executable(websocket-client-awaitable + Jamfile + websocket_client_awaitable.cpp) -add_executable (websocket-client-awaitable - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_client_awaitable.cpp -) + websocket_client_awaitable.cpp) -target_link_libraries(websocket-client-awaitable - lib-asio - lib-beast) +target_link_libraries(websocket-client-awaitable PRIVATE Boost::beast) -set_property(TARGET websocket-client-awaitable PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-awaitable + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/coro-ssl/CMakeLists.txt b/example/websocket/client/coro-ssl/CMakeLists.txt index fe9db75c4c..a6673ebc40 100644 --- a/example/websocket/client/coro-ssl/CMakeLists.txt +++ b/example/websocket/client/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/coro-ssl "/") +add_executable(websocket-client-coro-ssl + Jamfile + websocket_client_coro_ssl.cpp) - add_executable (websocket-client-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_coro_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_client_coro_ssl.cpp) - set_property(TARGET websocket-client-coro-ssl PROPERTY FOLDER "example-websocket-client") +target_include_directories(websocket-client-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-client-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-client-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-client-coro-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/coro/CMakeLists.txt b/example/websocket/client/coro/CMakeLists.txt index 2bfeef282a..0d7c78fda3 100644 --- a/example/websocket/client/coro/CMakeLists.txt +++ b/example/websocket/client/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/coro "/") +add_executable(websocket-client-coro + Jamfile + websocket_client_coro.cpp) -add_executable (websocket-client-coro - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_client_coro.cpp -) + websocket_client_coro.cpp) -target_link_libraries(websocket-client-coro - lib-asio - lib-beast) +target_link_libraries(websocket-client-coro PRIVATE Boost::beast) -set_property(TARGET websocket-client-coro PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-coro + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/sync-ssl/CMakeLists.txt b/example/websocket/client/sync-ssl/CMakeLists.txt index b844957022..8edc3e9ae2 100644 --- a/example/websocket/client/sync-ssl/CMakeLists.txt +++ b/example/websocket/client/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/client/sync-ssl "/") +add_executable(websocket-client-sync-ssl + Jamfile + websocket_client_sync_ssl.cpp) - add_executable (websocket-client-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_sync_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_client_sync_ssl.cpp) - set_property(TARGET websocket-client-sync-ssl PROPERTY FOLDER "example-websocket-client") +target_include_directories(websocket-client-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-client-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-client-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-client-sync-ssl + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/client/sync/CMakeLists.txt b/example/websocket/client/sync/CMakeLists.txt index d8606ab55d..859617d77f 100644 --- a/example/websocket/client/sync/CMakeLists.txt +++ b/example/websocket/client/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/client/sync "/") +add_executable(websocket-client-sync + Jamfile + websocket_client_sync.cpp) -add_executable (websocket-client-sync - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_client_sync.cpp -) + websocket_client_sync.cpp) -target_link_libraries(websocket-client-sync - lib-asio - lib-beast) +target_link_libraries(websocket-client-sync PRIVATE Boost::beast) -set_property(TARGET websocket-client-sync PROPERTY FOLDER "example-websocket-client") +set_target_properties(websocket-client-sync + PROPERTIES FOLDER "example-websocket-client") diff --git a/example/websocket/server/CMakeLists.txt b/example/websocket/server/CMakeLists.txt index 62cb221edc..b25017a9c6 100644 --- a/example/websocket/server/CMakeLists.txt +++ b/example/websocket/server/CMakeLists.txt @@ -7,17 +7,17 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (async) -add_subdirectory (awaitable) -add_subdirectory (chat-multi) -add_subdirectory (coro) -add_subdirectory (fast) -add_subdirectory (stackless) -add_subdirectory (sync) +add_subdirectory(async) +add_subdirectory(awaitable) +add_subdirectory(chat-multi) +add_subdirectory(coro) +add_subdirectory(fast) +add_subdirectory(stackless) +add_subdirectory(sync) if (OPENSSL_FOUND) - add_subdirectory (async-ssl) - add_subdirectory (coro-ssl) - add_subdirectory (stackless-ssl) - add_subdirectory (sync-ssl) -endif() + add_subdirectory(async-ssl) + add_subdirectory(coro-ssl) + add_subdirectory(stackless-ssl) + add_subdirectory(sync-ssl) +endif () diff --git a/example/websocket/server/async-ssl/CMakeLists.txt b/example/websocket/server/async-ssl/CMakeLists.txt index 8f1055d2f5..6ff3c8bff3 100644 --- a/example/websocket/server/async-ssl/CMakeLists.txt +++ b/example/websocket/server/async-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/async-ssl "/") +add_executable(websocket-server-async-ssl + Jamfile + websocket_server_async_ssl.cpp) - add_executable (websocket-server-async-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_async_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_server_async_ssl.cpp) - set_property(TARGET websocket-server-async-ssl PROPERTY FOLDER "example-websocket-server") +target_include_directories(websocket-server-async-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-server-async-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-server-async-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-server-async-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/async/CMakeLists.txt b/example/websocket/server/async/CMakeLists.txt index 0e1ceb8b6c..854ed96caf 100644 --- a/example/websocket/server/async/CMakeLists.txt +++ b/example/websocket/server/async/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/async "/") +add_executable(websocket-server-async + Jamfile + websocket_server_async.cpp) -add_executable (websocket-server-async - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_async.cpp -) + websocket_server_async.cpp) -target_link_libraries(websocket-server-async - lib-asio - lib-beast) +target_link_libraries(websocket-server-async PRIVATE Boost::beast) -set_property(TARGET websocket-server-async PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-async + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/awaitable/CMakeLists.txt b/example/websocket/server/awaitable/CMakeLists.txt index 2a99bc82e2..0c20d00b2d 100644 --- a/example/websocket/server/awaitable/CMakeLists.txt +++ b/example/websocket/server/awaitable/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/awaitable "/") +add_executable(websocket-server-awaitable + Jamfile + websocket_server_awaitable.cpp) -add_executable (websocket-server-awaitable - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_awaitable.cpp -) + websocket_server_awaitable.cpp) -target_link_libraries(websocket-server-awaitable - lib-asio - lib-beast) +target_link_libraries(websocket-server-awaitable PRIVATE Boost::beast) -set_property(TARGET websocket-server-awaitable PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-awaitable + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/chat-multi/CMakeLists.txt b/example/websocket/server/chat-multi/CMakeLists.txt index a256b000fb..355004df05 100644 --- a/example/websocket/server/chat-multi/CMakeLists.txt +++ b/example/websocket/server/chat-multi/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,35 +8,37 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/chat-multi "/") +add_executable(websocket-chat-multi + beast.hpp + chat_client.html + http_session.cpp + http_session.hpp + Jamfile + listener.cpp + listener.hpp + main.cpp + net.hpp + shared_state.cpp + shared_state.hpp + websocket_session.cpp + websocket_session.hpp) -file (GLOB APP_FILES - beast.hpp - http_session.cpp - http_session.hpp - Jamfile - listener.cpp - listener.hpp - main.cpp - net.hpp - shared_state.cpp - shared_state.hpp - websocket_session.cpp - websocket_session.hpp - chat_client.html - README.md -) +source_group("" FILES + beast.hpp + chat_client.html + http_session.cpp + http_session.hpp + Jamfile + listener.cpp + listener.hpp + main.cpp + net.hpp + shared_state.cpp + shared_state.hpp + websocket_session.cpp + websocket_session.hpp) -source_group ("" FILES ${APP_FILES}) +target_link_libraries(websocket-chat-multi PRIVATE Boost::beast) -add_executable (websocket-chat-multi - ${APP_FILES} - ${BOOST_BEAST_FILES} -) - -target_link_libraries(websocket-chat-multi - lib-asio - lib-beast) - -set_property(TARGET websocket-chat-multi PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-chat-multi + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/coro-ssl/CMakeLists.txt b/example/websocket/server/coro-ssl/CMakeLists.txt index a302a2f566..ff76ffe287 100644 --- a/example/websocket/server/coro-ssl/CMakeLists.txt +++ b/example/websocket/server/coro-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/coro-ssl "/") +add_executable(websocket-server-coro-ssl + Jamfile + websocket_server_coro_ssl.cpp) - add_executable (websocket-server-coro-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_coro_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_server_coro_ssl.cpp) - set_property(TARGET websocket-server-coro-ssl PROPERTY FOLDER "example-websocket-server") +target_include_directories(websocket-server-coro-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-server-coro-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-server-coro-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-server-coro-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/coro/CMakeLists.txt b/example/websocket/server/coro/CMakeLists.txt index c8e408d1c1..87eb5cb399 100644 --- a/example/websocket/server/coro/CMakeLists.txt +++ b/example/websocket/server/coro/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/coro "/") +add_executable(websocket-server-coro + Jamfile + websocket_server_coro.cpp) -add_executable (websocket-server-coro - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_coro.cpp -) + websocket_server_coro.cpp) -target_link_libraries(websocket-server-coro - lib-asio - lib-beast) +target_link_libraries(websocket-server-coro PRIVATE Boost::beast) -set_property(TARGET websocket-server-coro PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-coro + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/fast/CMakeLists.txt b/example/websocket/server/fast/CMakeLists.txt index 93d469e918..562407f79c 100644 --- a/example/websocket/server/fast/CMakeLists.txt +++ b/example/websocket/server/fast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/fast "/") +add_executable(websocket-server-fast + Jamfile + websocket_server_fast.cpp) -add_executable (websocket-server-fast - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_fast.cpp -) + websocket_server_fast.cpp) -target_link_libraries(websocket-server-fast - lib-asio - lib-beast) +target_link_libraries(websocket-server-fast PRIVATE Boost::beast) -set_property(TARGET websocket-server-fast PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-fast + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/stackless-ssl/CMakeLists.txt b/example/websocket/server/stackless-ssl/CMakeLists.txt index 7ae66a07be..148b101851 100644 --- a/example/websocket/server/stackless-ssl/CMakeLists.txt +++ b/example/websocket/server/stackless-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/stackless-ssl "/") +add_executable(websocket-server-stackless-ssl + Jamfile + websocket_server_stackless_ssl.cpp) - add_executable (websocket-server-stackless-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_stackless_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_server_stackless_ssl.cpp) - set_property(TARGET websocket-server-stackless-ssl PROPERTY FOLDER "example-websocket-server") +target_include_directories(websocket-server-stackless-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-server-stackless-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-server-stackless-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-server-stackless-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/stackless/CMakeLists.txt b/example/websocket/server/stackless/CMakeLists.txt index b260ca48bc..9afa7529da 100644 --- a/example/websocket/server/stackless/CMakeLists.txt +++ b/example/websocket/server/stackless/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/stackless "/") +add_executable(websocket-server-stackless + Jamfile + websocket_server_stackless.cpp) -add_executable (websocket-server-stackless - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_stackless.cpp -) + websocket_server_stackless.cpp) -target_link_libraries(websocket-server-stackless - lib-asio - lib-beast) +target_link_libraries(websocket-server-stackless PRIVATE Boost::beast) -set_property(TARGET websocket-server-stackless PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-stackless + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/sync-ssl/CMakeLists.txt b/example/websocket/server/sync-ssl/CMakeLists.txt index 0ad254ce55..4b32c898a9 100644 --- a/example/websocket/server/sync-ssl/CMakeLists.txt +++ b/example/websocket/server/sync-ssl/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,19 @@ # Official repository: https://github.com/boostorg/beast # -if (OPENSSL_FOUND) - GroupSources(include/boost/beast beast) - GroupSources(example/common common) - GroupSources(example/websocket/server/sync-ssl "/") +add_executable(websocket-server-sync-ssl + Jamfile + websocket_server_sync_ssl.cpp) - add_executable (websocket-server-sync-ssl - ${BOOST_BEAST_FILES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_sync_ssl.cpp - ) +source_group("" FILES + Jamfile + websocket_server_sync_ssl.cpp) - set_property(TARGET websocket-server-sync-ssl PROPERTY FOLDER "example-websocket-server") +target_include_directories(websocket-server-sync-ssl + PRIVATE ${PROJECT_SOURCE_DIR}) - target_link_libraries (websocket-server-sync-ssl - OpenSSL::SSL OpenSSL::Crypto - lib-asio - lib-asio-ssl - lib-beast - ) +target_link_libraries(websocket-server-sync-ssl + PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) -endif() +set_target_properties(websocket-server-sync-ssl + PROPERTIES FOLDER "example-websocket-server") diff --git a/example/websocket/server/sync/CMakeLists.txt b/example/websocket/server/sync/CMakeLists.txt index 4869986155..7e2030555d 100644 --- a/example/websocket/server/sync/CMakeLists.txt +++ b/example/websocket/server/sync/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,17 +8,15 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/websocket/server/sync "/") +add_executable(websocket-server-sync + Jamfile + websocket_server_sync.cpp) -add_executable (websocket-server-sync - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - websocket_server_sync.cpp -) + websocket_server_sync.cpp) -target_link_libraries(websocket-server-sync - lib-asio - lib-beast) +target_link_libraries(websocket-server-sync PRIVATE Boost::beast) -set_property(TARGET websocket-server-sync PROPERTY FOLDER "example-websocket-server") +set_target_properties(websocket-server-sync + PROPERTIES FOLDER "example-websocket-server") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5cfff564cc..02b39c4aec 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,70 +8,84 @@ # Official repository: https://github.com/boostorg/beast # -include_directories (./extern) -include_directories (./extras/include) - -file (GLOB_RECURSE EXTRAS_FILES - ${PROJECT_SOURCE_DIR}/test/extras/include/*.hpp - ${PROJECT_SOURCE_DIR}/test/extras/include/*.ipp - ${PROJECT_SOURCE_DIR}/test/lib_ssl.cpp - ) +if(BOOST_BEAST_IS_ROOT) + set(EXCLUDE_TESTS_FROM_ALL) +else() + set(EXCLUDE_TESTS_FROM_ALL EXCLUDE_FROM_ALL) +endif() -if (OPENSSL_FOUND) - link_libraries (${OPENSSL_LIBRARIES}) +if(NOT TARGET tests) + add_custom_target(tests ${EXCLUDE_TESTS_FROM_ALL}) + set_property(TARGET tests PROPERTY FOLDER Dependencies) endif() -set (ZLIB_SOURCES - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/crc32.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/deflate.h - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzguts.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffast.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffixed.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inflate.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inftrees.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/trees.h - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zconf.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zlib.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zutil.h - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/adler32.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/compress.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/crc32.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/deflate.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzclose.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzlib.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzread.c - #${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/gzwrite.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/infback.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inffast.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inflate.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/inftrees.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/trees.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/uncompr.c - ${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12/zutil.c -) +find_package(Threads REQUIRED) +find_package(OpenSSL REQUIRED) -add_library ( - lib-zlib - ${ZLIB_SOURCES} -) -target_include_directories(lib-zlib PUBLIC "${CMAKE_CURRENT_LIST_DIR}/extern/zlib-1.2.12") -set_property(TARGET lib-zlib PROPERTY FOLDER "static-libs") +# lib-asio +add_library(lib-asio STATIC lib_asio.cpp) +source_group("" FILES lib_asio.cpp) +target_compile_definitions(lib-asio PUBLIC + BOOST_ASIO_SEPARATE_COMPILATION + BOOST_ASIO_NO_DEPRECATED + BOOST_ASIO_DISABLE_BOOST_ARRAY + BOOST_ASIO_DISABLE_BOOST_BIND + BOOST_ASIO_DISABLE_BOOST_DATE_TIME + BOOST_ASIO_DISABLE_BOOST_REGEX) +target_link_libraries(lib-asio PUBLIC Boost::asio Threads::Threads) +set_target_properties(lib-asio PROPERTIES FOLDER "static-libs") -set (TEST_MAIN ${PROJECT_SOURCE_DIR}/test/lib_beast.cpp) +# lib-asio-ssl +add_library(lib-asio-ssl STATIC lib_asio_ssl.cpp) +source_group("" FILES lib_asio_ssl.cpp) +target_link_libraries(lib-asio-ssl PUBLIC lib-asio) +target_link_libraries(lib-asio-ssl PUBLIC OpenSSL::SSL OpenSSL::Crypto) +set_target_properties(lib-asio-ssl PROPERTIES FOLDER "static-libs") -GroupSources (. "/") +# lib-beast +add_library(lib-beast STATIC lib_beast.cpp) +source_group("" FILES lib_beast.cpp) +target_compile_definitions(lib-beast PUBLIC + BOOST_BEAST_SEPARATE_COMPILATION + BOOST_BEAST_ALLOW_DEPRECATED + BOOST_BEAST_TESTS) +target_link_libraries(lib-beast PUBLIC Boost::beast lib-asio) +set_target_properties(lib-beast PROPERTIES FOLDER "static-libs") -add_library ( - lib-test STATIC - ${CMAKE_CURRENT_LIST_DIR}/lib_test.cpp -) +# lib-zlib +enable_language(C) +add_library(lib-zlib STATIC + extern/zlib-1.2.12/adler32.c + extern/zlib-1.2.12/compress.c + extern/zlib-1.2.12/crc32.c + extern/zlib-1.2.12/deflate.c + extern/zlib-1.2.12/infback.c + extern/zlib-1.2.12/inffast.c + extern/zlib-1.2.12/inflate.c + extern/zlib-1.2.12/inftrees.c + extern/zlib-1.2.12/trees.c + extern/zlib-1.2.12/uncompr.c + extern/zlib-1.2.12/zutil.c) +target_compile_options(lib-zlib PRIVATE + $<$:-w> + $<$:/wd4127> + $<$:/wd4244> + $<$:/wd4131>) +target_include_directories(lib-zlib PUBLIC extern/zlib-1.2.12) +set_target_properties(lib-zlib PROPERTIES FOLDER "static-libs") -set_property(TARGET lib-test PROPERTY FOLDER "static-libs") +# lib-test +add_library(lib-test STATIC lib_test.cpp) +source_group("" FILES lib_test.cpp) +target_include_directories(lib-test PUBLIC extras/include) +target_link_libraries(lib-test PUBLIC lib-beast) +set_target_properties(lib-test PROPERTIES FOLDER "static-libs") -add_subdirectory (beast) -add_subdirectory (bench) -add_subdirectory (doc) -add_subdirectory (example) -if (Beast_BUILD_FUZZERS AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +add_subdirectory(beast) +add_subdirectory(bench) +add_subdirectory(doc) +add_subdirectory(example) + +if (BOOST_BEAST_BUILD_FUZZERS AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_subdirectory(fuzz) -endif() +endif () diff --git a/test/beast/CMakeLists.txt b/test/beast/CMakeLists.txt index 72323449d5..03a6723d65 100644 --- a/test/beast/CMakeLists.txt +++ b/test/beast/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,73 +8,37 @@ # Official repository: https://github.com/boostorg/beast # -function(build_individual_tests prefix) - set(options ) - set(oneValueArgs ) - set(multiValueArgs EXCLUDE LIBS EXTRA) - cmake_parse_arguments(bit "${options}" - "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) +add_subdirectory(_experimental) +add_subdirectory(core) +add_subdirectory(http) +add_subdirectory(ssl) +add_subdirectory(websocket) +add_subdirectory(zlib) - file(GLOB test_srcs "*.cpp") - set(individual_tests) - foreach(test_src IN LISTS test_srcs) - get_filename_component(test_suffix "${test_src}" NAME_WE) - if(NOT test_suffix IN_LIST bit_EXCLUDE) - set(test_name "${prefix}-${test_suffix}") - add_executable("${test_name}" EXCLUDE_FROM_ALL "${test_src}") - foreach(lib IN LISTS bit_LIBS) - target_link_libraries("${test_name}" "${lib}") - endforeach() - list(APPEND individual_tests COMMAND "${test_name}") - endif() - endforeach() - - add_custom_target("${prefix}-all" ${individual_tests}) -endfunction() - -add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED) - -# For buffers_cat -add_definitions (-DBOOST_BEAST_TESTS) - -add_subdirectory (_experimental) -add_subdirectory (core) -add_subdirectory (http) -add_subdirectory (ssl) -add_subdirectory (websocket) -add_subdirectory (zlib) - -#------------------------------------------------------------------------------- - -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost /) -GroupSources (test/beast /) +add_executable(tests-beast + Jamfile + core.cpp + http.cpp + ssl.cpp + version.cpp + websocket.cpp + zlib.cpp) -add_executable (tests-beast - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} +source_group("" FILES Jamfile core.cpp http.cpp ssl.cpp version.cpp websocket.cpp - zlib.cpp -) + zlib.cpp) target_link_libraries(tests-beast - lib-asio lib-asio-ssl - lib-beast lib-test) -set_property(TARGET tests-beast PROPERTY FOLDER "tests") +set_target_properties(tests-beast + PROPERTIES FOLDER "tests") -#add_custom_target(tests-beast-all -# DEPENDS -# tests-beast-_experimental-all -# tests-beast-core-all -# tests-beast-http-all -# tests-beast-ssl-all -# tests-beast-websocket-all -# tests-beast-zlib-all ) +add_test(NAME tests-beast COMMAND tests-beast) +add_dependencies(tests tests-beast) diff --git a/test/beast/_experimental/CMakeLists.txt b/test/beast/_experimental/CMakeLists.txt index 34e4dbadae..59bd28c74b 100644 --- a/test/beast/_experimental/CMakeLists.txt +++ b/test/beast/_experimental/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,29 +8,26 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/_experimental "/") +add_executable(tests-beast-_experimental + Jamfile + _test_detail_stream_state.cpp + error.cpp + icy_stream.cpp + stream.cpp) -add_executable (tests-beast-_experimental - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile _test_detail_stream_state.cpp error.cpp icy_stream.cpp - stream.cpp -) + stream.cpp) target_link_libraries(tests-beast-_experimental - lib-asio - lib-beast - lib-test - ) + lib-asio-ssl + lib-test) -set_property(TARGET tests-beast-_experimental PROPERTY FOLDER "tests") +set_target_properties(tests-beast-_experimental + PROPERTIES FOLDER "tests") -# -# Individual tests -# -#build_individual_tests(tests-beast-_experimental -# EXCLUDE -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +add_test(NAME tests-beast-_experimental COMMAND tests-beast-_experimental) +add_dependencies(tests tests-beast-_experimental) diff --git a/test/beast/core/CMakeLists.txt b/test/beast/core/CMakeLists.txt index 51e56dd2ee..6d77a028bd 100644 --- a/test/beast/core/CMakeLists.txt +++ b/test/beast/core/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,78 +8,18 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/core "/") +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) -add_executable (tests-beast-core - ${BOOST_BEAST_FILES} - Jamfile - test_buffer.hpp - file_test.hpp - stream_tests.hpp - test_handler.hpp - _detail_base64.cpp - _detail_bind_continuation.cpp - _detail_buffer.cpp - _detail_clamp.cpp - _detail_get_io_context.cpp - _detail_is_invocable.cpp - _detail_read.cpp - _detail_sha1.cpp - _detail_tuple.cpp - _detail_variant.cpp - _detail_varint.cpp - async_base.cpp - basic_stream.cpp - bind_handler.cpp - buffer_ref.cpp - buffer_traits.cpp - buffered_read_stream.cpp - buffers_adaptor.cpp - buffers_cat.cpp - buffers_generator.cpp - buffers_prefix.cpp - buffers_range.cpp - buffers_suffix.cpp - buffers_to_string.cpp - detect_ssl.cpp - error.cpp - file.cpp - file_base.cpp - file_posix.cpp - file_stdio.cpp - file_win32.cpp - filtering_cancellation_slot.cpp - flat_buffer.cpp - flat_static_buffer.cpp - flat_stream.cpp - make_printable.cpp - multi_buffer.cpp - ostream.cpp - rate_policy.cpp - read_size.cpp - role.cpp - saved_handler.cpp - span.cpp - static_buffer.cpp - static_string.cpp - stream_traits.cpp - string.cpp - tcp_stream.cpp -) +add_executable(tests-beast-core ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-core - lib-asio - lib-asio-ssl - lib-beast lib-test - ) + Boost::filesystem) -set_property(TARGET tests-beast-core PROPERTY FOLDER "tests") +set_target_properties(tests-beast-core + PROPERTIES FOLDER "tests") -# -# Individual tests -# -#build_individual_tests(tests-beast-core -# EXCLUDE _detail_static_const close_socket zlib make_strand prepare_buffers -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +add_test(NAME tests-beast-core COMMAND tests-beast-core) +add_dependencies(tests tests-beast-core) diff --git a/test/beast/core/_detail_static_const.cpp b/test/beast/core/_detail_static_const.cpp deleted file mode 100644 index 9c15f42f03..0000000000 --- a/test/beast/core/_detail_static_const.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include - -#include - -namespace boost { -namespace beast { - -struct foo_impl -{ - void operator()() const noexcept - { - BEAST_PASS(); - } -}; - -constexpr auto& bar = - boost::beast::detail::static_const::value; - -class static_const_test : public beast::unit_test::suite -{ -public: - void - run() override - { - pass(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,static_const); - -} // beast -} // boost diff --git a/test/beast/core/close_socket.cpp b/test/beast/core/close_socket.cpp deleted file mode 100644 index 01703c3f27..0000000000 --- a/test/beast/core/close_socket.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (c) 2018 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace boost { -namespace beast { - -class close_socket_test : public beast::unit_test::suite -{ -public: - void - run() override - { - testClose(); - testJavadocs(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,close_socket); - -} // beast -} // boost diff --git a/test/beast/core/make_strand.cpp b/test/beast/core/make_strand.cpp deleted file mode 100644 index fa06276d29..0000000000 --- a/test/beast/core/make_strand.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - -#include -#include -#include - -namespace boost { -namespace beast { - -class make_strand_test : public beast::unit_test::suite -{ -public: - void - testFunction() - { - net::io_context ioc; - net::make_strand(ioc); - net::make_strand(ioc.get_executor()); - net::make_strand(net::make_strand(ioc)); - - net::any_io_executor ex(ioc.get_executor()); - net::make_strand(ex); - - // this *should-not* compile - //net::make_strand(ex.context()); - } - - void - run() override - { - testFunction(); - pass(); - } -}; - -BEAST_DEFINE_TESTSUITE(beast,core,net::make_strand); - -} // beast -} // boost diff --git a/test/beast/core/prepare_buffers.cpp b/test/beast/core/prepare_buffers.cpp deleted file mode 100644 index 3a9902de5f..0000000000 --- a/test/beast/core/prepare_buffers.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// -// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include - diff --git a/test/beast/core/zlib.cpp b/test/beast/core/zlib.cpp deleted file mode 100644 index 6662e61c70..0000000000 --- a/test/beast/core/zlib.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// -// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -// Test that header file is self-contained. -#include -#include - -#include -#include -#include -#include -#include - -namespace boost { -namespace beast { -namespace zlib { - -class zlib_test : public beast::unit_test::suite -{ -public: - class buffer - { - std::size_t size_ = 0; - std::size_t capacity_ = 0; - std::unique_ptr p_; - - public: - buffer() = default; - buffer(buffer&&) = default; - buffer& operator=(buffer&&) = default; - - - explicit - buffer(std::size_t capacity) - { - reserve(capacity); - } - - bool - empty() const - { - return size_ == 0; - } - - std::size_t - size() const - { - return size_; - } - - std::size_t - capacity() const - { - return capacity_; - } - - std::uint8_t const* - data() const - { - return p_.get(); - } - - std::uint8_t* - data() - { - return p_.get(); - } - - void - reserve(std::size_t capacity) - { - if(capacity != capacity_) - { - p_.reset(new std::uint8_t[capacity]); - capacity_ = capacity; - } - } - - void - resize(std::size_t size) - { - assert(size <= capacity_); - size_ = size; - } - }; - - buffer - make_source1(std::size_t size) - { - std::mt19937 rng; - buffer b(size); - auto p = b.data(); - std::size_t n = 0; - static std::string const chars( - "01234567890{}\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - "{{{{{{{{{{}}}}}}}}}} "); - while(n < size) - { - *p++ = chars[rng()%chars.size()]; - ++n; - } - b.resize(n); - return b; - } - - buffer - make_source2(std::size_t size) - { - std::mt19937 rng; - std::array const i{0, 65535}; - std::array const w{0, 1}; - std::piecewise_linear_distribution d( - i.begin(), i.end(), w.begin()); - buffer b(size); - auto p = b.data(); - std::size_t n = 0; - while(n < size) - { - if(n == 1) - { - *p++ = rng()%256; - ++n; - continue; - } - auto const v = static_cast(d(rng)); - *p++ = v>>8; - *p++ = v&0xff; - n += 2; - - } - b.resize(n); - return b; - } - - void - checkInflate(buffer const& input, buffer const& original) - { - for(std::size_t i = 0; i < input.size(); ++i) - { - buffer output(original.size()); - inflate_stream zs; - zs.avail_in = 0; - zs.next_in = 0; - zs.next_out = output.data(); - zs.avail_out = output.capacity(); - if(i > 0) - { - zs.next_in = (Byte*)input.data(); - zs.avail_in = i; - auto result = zs.write(Z_FULL_FLUSH); - expect(result == Z_OK); - } - zs.next_in = (Byte*)input.data() + i; - zs.avail_in = input.size() - i; - auto result = zs.write(Z_FULL_FLUSH); - output.resize(output.capacity() - zs.avail_out); - expect(result == Z_OK); - expect(output.size() == original.size()); - expect(std::memcmp( - output.data(), original.data(), original.size()) == 0); - } - } - - void testSpecial() - { - { - deflate_stream zs; - } - { - inflate_stream zs; - } - } - - void testCompress() - { - static std::size_t constexpr N = 2048; - for(int source = 0; source <= 1; ++source) - { - buffer original; - switch(source) - { - case 0: - original = make_source1(N); - break; - case 1: - original = make_source2(N); - break; - } - for(int level = 0; level <= 9; ++level) - { - for(int strategy = 0; strategy <= 4; ++strategy) - { - for(int wbits = 15; wbits <= 15; ++wbits) - { - deflate_stream zs; - zs.avail_in = 0; - zs.next_in = 0; - expect(deflate_stream::deflateInit2(&zs, - level, - wbits, - 4, - strategy) == Z_OK); - buffer output(deflate_stream::deflateBound(&zs, original.size())); - zs.next_in = (Byte*)original.data(); - zs.avail_in = original.size(); - zs.next_out = output.data(); - zs.avail_out = output.capacity(); - auto result = zs.deflate(Z_FULL_FLUSH); - expect(result == Z_OK); - output.resize(output.capacity() - zs.avail_out); - checkInflate(output, original); - } - } - } - } - } - - void run() override - { - testSpecial(); - testCompress(); - } -}; - -BEAST_DEFINE_TESTSUITE(zlib,core,beast); - -} // zlib -} // beast -} // boost diff --git a/test/beast/http/CMakeLists.txt b/test/beast/http/CMakeLists.txt index d9e1cd88d5..27ffeb897c 100644 --- a/test/beast/http/CMakeLists.txt +++ b/test/beast/http/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,67 +8,18 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/beast/http "/") +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) -add_executable (tests-beast-http - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} - Jamfile - any_completion_handler.cpp - basic_dynamic_body_fwd.cpp - basic_dynamic_body.cpp - basic_file_body_fwd.cpp - basic_file_body.cpp - basic_parser.cpp - buffer_body_fwd.cpp - buffer_body.cpp - chunk_encode.cpp - deferred.cpp - dynamic_body_fwd.cpp - dynamic_body.cpp - empty_body_fwd.cpp - empty_body.cpp - error.cpp - field_compiles.cpp - field.cpp - fields_fwd.cpp - fields.cpp - file_body_fwd.cpp - file_body.cpp - message_fwd.cpp - message_generator_fwd.cpp - message_generator.cpp - message.cpp - parser_fwd.cpp - parser.cpp - read.cpp - rfc7230.cpp - serializer_fwd.cpp - serializer.cpp - span_body_fwd.cpp - span_body.cpp - status.cpp - string_body_fwd.cpp - string_body.cpp - type_traits.cpp - vector_body_fwd.cpp - vector_body.cpp - verb.cpp - write.cpp -) +add_executable(tests-beast-http ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-http - lib-asio - lib-asio-ssl - lib-beast lib-test - ) + Boost::filesystem) -set_property(TARGET tests-beast-http PROPERTY FOLDER "tests") +set_target_properties(tests-beast-http + PROPERTIES FOLDER "tests") -# -# Individual tests -# -#build_individual_tests(tests-beast-http LIBS lib-asio lib-asio-ssl lib-beast lib-test) +add_test(NAME tests-beast-http COMMAND tests-beast-http) +add_dependencies(tests tests-beast-http) diff --git a/test/beast/ssl/CMakeLists.txt b/test/beast/ssl/CMakeLists.txt index 04f7fa1162..6694d865fe 100644 --- a/test/beast/ssl/CMakeLists.txt +++ b/test/beast/ssl/CMakeLists.txt @@ -7,22 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/ssl "/") - add_executable (tests-beast-ssl - ${BOOST_BEAST_FILES} Jamfile - ssl_stream.cpp -) + ssl_stream.cpp) + +source_group("" FILES + Jamfile + ssl_stream.cpp) target_link_libraries(tests-beast-ssl - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-beast-ssl PROPERTY FOLDER "tests") +set_target_properties(tests-beast-ssl + PROPERTIES FOLDER "tests") -#build_individual_tests(tests-beast-ssl LIBS lib-asio lib-asio-ssl lib-beast lib-test) +add_test(NAME tests-beast-ssl COMMAND tests-beast-ssl) +add_dependencies(tests tests-beast-ssl) diff --git a/test/beast/websocket/CMakeLists.txt b/test/beast/websocket/CMakeLists.txt index 3610c9b169..15d842ea10 100644 --- a/test/beast/websocket/CMakeLists.txt +++ b/test/beast/websocket/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,53 +8,18 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/beast/websocket "/") +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) -add_executable (tests-beast-websocket - ${BOOST_BEAST_FILES} - ${EXTRAS_FILES} - Jamfile - _detail_decorator.cpp - _detail_prng.cpp - _detail_impl_base.cpp - test.hpp - _detail_prng.cpp - any_completion_handler.cpp - accept.cpp - cancel.cpp - close.cpp - deferred.cpp - error.cpp - frame.cpp - handshake.cpp - option.cpp - ping.cpp - read1.cpp - read2.cpp - read3.cpp - rfc6455.cpp - ssl.cpp - stream.cpp - stream_base.cpp - stream_explicit.cpp - stream_fwd.cpp - teardown.cpp - timer.cpp - utf8_checker.cpp - write.cpp -) +add_executable(tests-beast-websocket ${PFILES}) + +source_group("" FILES ${PFILES}) target_link_libraries(tests-beast-websocket - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) -set_property(TARGET tests-beast-websocket PROPERTY FOLDER "tests") +set_target_properties(tests-beast-websocket + PROPERTIES FOLDER "tests") -#build_individual_tests(tests-beast-websocket -# EXCLUDE doc_snippets -# LIBS lib-asio lib-asio-ssl lib-beast lib-test) +add_test(NAME tests-beast-websocket COMMAND tests-beast-websocket) +add_dependencies(tests tests-beast-websocket) diff --git a/test/beast/websocket/doc_snippets.cpp b/test/beast/websocket/doc_snippets.cpp deleted file mode 100644 index 4e8ae0eafb..0000000000 --- a/test/beast/websocket/doc_snippets.cpp +++ /dev/null @@ -1,285 +0,0 @@ -// -// Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/beast -// - -#include -#include -#include -#include -#include -#include -#include -#include - -//[ws_snippet_1 -#include -using namespace boost::beast::websocket; -//] - -using namespace boost::beast; - -namespace doc_ws_snippets { - -void fxx() { - -net::io_service ios; -net::io_service::work work{ios}; -std::thread t{[&](){ ios.run(); }}; -error_code ec; -net::ip::tcp::socket sock{ios}; - -{ -//[ws_snippet_2 - stream ws{ios}; -//] -} - -{ -//[ws_snippet_3 - stream ws{std::move(sock)}; -//] -} - -{ -//[ws_snippet_4 - stream ws{sock}; -//] - -//[ws_snippet_5 - ws.next_layer().shutdown(net::ip::tcp::socket::shutdown_send); -//] -} - -{ -//[ws_snippet_6 - std::string const host = "mywebapp.com"; - net::ip::tcp::resolver r{ios}; - stream ws{ios}; - net::connect(ws.next_layer(), r.resolve({host, "ws"})); -//] -} - -{ -//[ws_snippet_7 - net::ip::tcp::acceptor acceptor{ios}; - stream ws{acceptor.get_io_service()}; - acceptor.accept(ws.next_layer()); -//] -} - -{ - stream ws{ios}; -//[ws_snippet_8 - ws.handshake("localhost", "/"); -//] - -//[ws_snippet_9 - ws.handshake_ex("localhost", "/", - [](request_type& m) - { - m.insert(http::field::sec_websocket_protocol, "xmpp;ws-chat"); - }); -//] - -//[ws_snippet_10 - response_type res; - ws.handshake(res, "localhost", "/"); - if(! res.count(http::field::sec_websocket_protocol)) - throw std::invalid_argument("missing subprotocols"); -//] - -//[ws_snippet_11 - ws.accept(); -//] - -//[ws_snippet_12 - ws.accept_ex( - [](response_type& m) - { - m.insert(http::field::server, "MyServer"); - }); -//] -} - -{ -//[ws_snippet_13] - // Buffer required for reading HTTP messages - flat_buffer buffer; - - // Read the HTTP request ourselves - http::request req; - http::read(sock, buffer, req); - - // See if its a WebSocket upgrade request - if(websocket::is_upgrade(req)) - { - // Construct the stream, transferring ownership of the socket - stream ws{std::move(sock)}; - - // Accept the request from our message. Clients SHOULD NOT - // begin sending WebSocket frames until the server has - // provided a response, but just in case they did, we pass - // any leftovers in the buffer to the accept function. - // - ws.accept(req, buffer.data()); - } - else - { - // Its not a WebSocket upgrade, so - // handle it like a normal HTTP request. - } -//] -} - -{ - stream ws{ios}; -//[ws_snippet_14 - // Read into our buffer until we reach the end of the HTTP request. - // No parsing takes place here, we are just accumulating data. - net::streambuf buffer; - net::read_until(sock, buffer, "\r\n\r\n"); - - // Now accept the connection, using the buffered data. - ws.accept(buffer.data()); -//] -} -{ - stream ws{ios}; -//[ws_snippet_15 - multi_buffer buffer; - ws.read(buffer); - - ws.text(ws.got_text()); - ws.write(buffer.data()); - buffer.consume(buffer.size()); -//] -} - -{ - stream ws{ios}; -//[ws_snippet_16 - multi_buffer buffer; - for(;;) - if(ws.read_some(buffer, 0)) - break; - ws.binary(ws.got_binary()); - consuming_buffers cb{buffer.data()}; - for(;;) - { - using net::buffer_size; - if(buffer_size(cb) > 512) - { - ws.write_some(false, buffer_prefix(512, cb)); - cb.consume(512); - } - else - { - ws.write_some(true, cb); - break; - } - } -//] -} - -{ - stream ws{ios}; -//[ws_snippet_17 - auto cb = - [](frame_type kind, string_view payload) - { - // Do something with the payload - boost::ignore_unused(kind, payload); - }; - ws.control_callback(cb); -//] - -//[ws_snippet_18 - ws.close(close_code::normal); -//] - -//[ws_snippet_19 - ws.auto_fragment(true); - ws.write_buffer_size(16384); -//] - -//[ws_snippet_20 - multi_buffer buffer; - ws.async_read(buffer, - [](error_code, std::size_t) - { - // Do something with the buffer - }); -//] -} - -} // fxx() - -// workaround for https://github.com/chriskohlhoff/asio/issues/112 -#ifdef BOOST_MSVC -//[ws_snippet_21 -void echo(stream& ws, - multi_buffer& buffer, net::yield_context yield) -{ - ws.async_read(buffer, yield); - std::future fut = - ws.async_write(buffer.data(), net::use_future); -} -//] -#endif - -} // doc_ws_snippets - -//------------------------------------------------------------------------------ - -#if BOOST_BEAST_USE_OPENSSL - -//[wss_snippet_1 -#include -#include -//] - -namespace doc_wss_snippets { - -void fxx() { - -net::io_service ios; -net::io_service::work work{ios}; -std::thread t{[&](){ ios.run(); }}; -error_code ec; -net::ip::tcp::socket sock{ios}; - -{ -//[wss_snippet_2 - net::ssl::context ctx{net::ssl::context::tlsv12}; - stream> wss{ios, ctx}; -//] -} - -{ -//[wss_snippet_3 - net::ip::tcp::endpoint ep; - net::ssl::context ctx{net::ssl::context::tlsv12}; - stream> ws{ios, ctx}; - - // connect the underlying TCP/IP socket - ws.next_layer().next_layer().connect(ep); - - // perform SSL handshake - ws.next_layer().handshake(net::ssl::stream_base::client); - - // perform WebSocket handshake - ws.handshake("localhost", "/"); -//] -} - -} // fxx() - -} // doc_wss_snippets - -#endif - diff --git a/test/beast/zlib/CMakeLists.txt b/test/beast/zlib/CMakeLists.txt index 26df5289b0..b76174ab2b 100644 --- a/test/beast/zlib/CMakeLists.txt +++ b/test/beast/zlib/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,30 +8,29 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extern/zlib-1.2.12 zlib) -GroupSources (test/beast/zlib "/") - -if (MSVC) - set_source_files_properties (${ZLIB_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4131 /wd4244") -endif() +add_executable(tests-beast-zlib + Jamfile + error.cpp + deflate_stream.cpp + inflate_stream.cpp + zlib.cpp) -add_executable (tests-beast-zlib - ${BOOST_BEAST_FILES} - ${ZLIB_SOURCES} +source_group("" FILES Jamfile error.cpp deflate_stream.cpp inflate_stream.cpp - zlib.cpp -) + zlib.cpp) + +target_include_directories(tests-beast-zlib + PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) target_link_libraries(tests-beast-zlib - lib-asio - lib-beast lib-test - ) + lib-zlib) -set_property(TARGET tests-beast-zlib PROPERTY FOLDER "tests") +set_target_properties(tests-beast-zlib + PROPERTIES FOLDER "tests") -#build_individual_tests(tests-beast-zlib LIBS lib-asio lib-beast lib-test lib-zlib) +add_test(NAME tests-beast-zlib COMMAND tests-beast-zlib) +add_dependencies(tests tests-beast-zlib) diff --git a/test/bench/CMakeLists.txt b/test/bench/CMakeLists.txt index 849f032a9c..0f589b8e93 100644 --- a/test/bench/CMakeLists.txt +++ b/test/bench/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,8 +8,8 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (buffers) -add_subdirectory (parser) -add_subdirectory (utf8_checker) -add_subdirectory (wsload) -add_subdirectory (zlib) +add_subdirectory(buffers) +add_subdirectory(parser) +add_subdirectory(utf8_checker) +add_subdirectory(wsload) +add_subdirectory(zlib) diff --git a/test/bench/buffers/CMakeLists.txt b/test/bench/buffers/CMakeLists.txt index d05db11f43..9f0f1862f9 100644 --- a/test/bench/buffers/CMakeLists.txt +++ b/test/bench/buffers/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,16 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/buffers "/") +add_executable(bench-buffers + Jamfile + bench_buffers.cpp) -add_executable (bench-buffers - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - bench_buffers.cpp -) + bench_buffers.cpp) target_link_libraries(bench-buffers - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-buffers PROPERTY FOLDER "tests-bench") +set_target_properties(bench-buffers + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/parser/CMakeLists.txt b/test/bench/parser/CMakeLists.txt index 4a4eb2ce9d..ead38bd3be 100644 --- a/test/bench/parser/CMakeLists.txt +++ b/test/bench/parser/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,23 +8,23 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/beast/http "/") -GroupSources (test/bench/parser "/") +add_executable(bench-parser + Jamfile + nodejs_parser.hpp + nodejs_parser.cpp + bench_parser.cpp) -add_executable (bench-parser - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - ${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp nodejs_parser.hpp nodejs_parser.cpp - bench_parser.cpp -) + bench_parser.cpp) + +target_include_directories(bench-parser + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(bench-parser - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-parser PROPERTY FOLDER "tests-bench") +set_target_properties(bench-parser + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/utf8_checker/CMakeLists.txt b/test/bench/utf8_checker/CMakeLists.txt index 6164127a68..9a72d41fa4 100644 --- a/test/bench/utf8_checker/CMakeLists.txt +++ b/test/bench/utf8_checker/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,19 +8,16 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/utf8_checker "/") +add_executable(bench-utf8-checker + Jamfile + bench_utf8_checker.cpp) -add_executable (bench-utf8-checker - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - bench_utf8_checker.cpp -) + bench_utf8_checker.cpp) target_link_libraries(bench-utf8-checker - lib-asio - lib-beast - lib-test - ) + lib-test) -set_property(TARGET bench-utf8-checker PROPERTY FOLDER "tests-bench") +set_target_properties(bench-utf8-checker + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/wsload/CMakeLists.txt b/test/bench/wsload/CMakeLists.txt index 7a6c58760a..ce5743ac44 100644 --- a/test/bench/wsload/CMakeLists.txt +++ b/test/bench/wsload/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,18 +8,16 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/bench/wsload "/") +add_executable(bench-wsload + Jamfile + wsload.cpp) -add_executable (bench-wsload - ${BOOST_BEAST_FILES} +source_group("" FILES Jamfile - wsload.cpp - ) + wsload.cpp) target_link_libraries(bench-wsload - lib-asio - lib-beast - ) + lib-beast) -set_property(TARGET bench-wsload PROPERTY FOLDER "tests-bench") +set_target_properties(bench-wsload + PROPERTIES FOLDER "tests-bench") diff --git a/test/bench/zlib/CMakeLists.txt b/test/bench/zlib/CMakeLists.txt index 360f83ed99..c7ba626a7b 100644 --- a/test/bench/zlib/CMakeLists.txt +++ b/test/bench/zlib/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,22 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (test/extern/zlib-1.2.12 zlib) -GroupSources (test/bench/zlib "/") - -if (MSVC) - set_source_files_properties (${ZLIB_SOURCES} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4131 /wd4244") -endif() +add_executable(bench-zlib + Jamfile + deflate_stream.cpp + inflate_stream.cpp) -add_executable (bench-zlib - ${BOOST_BEAST_FILES} - ${ZLIB_SOURCES} +source_group("" FILES Jamfile deflate_stream.cpp - inflate_stream.cpp -) + inflate_stream.cpp) + +target_include_directories(bench-zlib + PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) + target_link_libraries(bench-zlib - lib-asio - lib-beast lib-test - ) + lib-zlib) -set_property(TARGET bench-zlib PROPERTY FOLDER "tests-bench") +set_target_properties(bench-zlib + PROPERTIES FOLDER "tests-bench") diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt new file mode 100644 index 0000000000..4872e3ddcd --- /dev/null +++ b/test/cmake_test/CMakeLists.txt @@ -0,0 +1,94 @@ +# +# Copyright (c) 2023 Christian Mazakas +# Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com) +# +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt +# + +cmake_minimum_required(VERSION 3.5...3.16) + +project(cmake_subdir_test LANGUAGES CXX) +set(__ignore__ ${CMAKE_C_COMPILER}) +set(__ignore__ ${CMAKE_C_FLAGS}) + +if(BOOST_CI_INSTALL_TEST) + find_package(Boost CONFIG REQUIRED COMPONENTS beast) +else() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + add_subdirectory(../.. boostorg/beast) + + set(BOOST_URL_BUILD_TESTS OFF CACHE BOOL "" FORCE) + + set(deps + # Primary dependencies + + asio + assert + bind + config + container + container_hash + core + endian + intrusive + logic + mp11 + optional + preprocessor + smart_ptr + static_assert + static_string + system + throw_exception + type_index + type_traits + winapi + + # Secondary dependencies + + align + context + date_time + move + describe + utility + variant2 + predef + pool + algorithm + io + lexical_cast + numeric/conversion + range + tokenizer + array + concept_check + exception + function + iterator + mpl + regex + tuple + unordered + conversion + integer + detail + function_types + fusion + functional + typeof + ) + + foreach(dep IN LISTS deps) + add_subdirectory(../../../${dep} boostorg/${dep} EXCLUDE_FROM_ALL) + endforeach() +endif() + +add_executable(main main.cpp) +source_group("" FILES main.cpp) +target_link_libraries(main Boost::beast) + +enable_testing() +add_test(NAME main COMMAND main) +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_test/main.cpp b/test/cmake_test/main.cpp new file mode 100644 index 0000000000..7995ea875e --- /dev/null +++ b/test/cmake_test/main.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + +} diff --git a/test/doc/CMakeLists.txt b/test/doc/CMakeLists.txt index 8d42bfbfa7..b5e6e5204c 100644 --- a/test/doc/CMakeLists.txt +++ b/test/doc/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,40 +8,21 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (example example) -GroupSources (test/doc "/") +file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.ipp *.hpp) -add_executable (tests-doc - ${BOOST_BEAST_FILES} - Jamfile - snippets.hpp - snippets.ipp - core_snippets.cpp - core_1_refresher.cpp - core_3_timeouts.cpp - core_4_layers.cpp - http_10_custom_parser.cpp - http_examples.cpp - http_snippets.cpp - websocket_common.ipp - websocket.cpp - websocket_1_connecting.cpp - websocket_2_handshaking.cpp - websocket_3_decorator.cpp - websocket_4_messages.cpp - websocket_5_control_frames.cpp - websocket_6_timeouts.cpp - websocket_7_teardown.cpp - websocket_8_notes.cpp - exemplars.cpp -) +add_executable(tests-doc ${PFILES}) + +source_group("" FILES ${PFILES}) + +target_include_directories(tests-doc + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(tests-doc - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) + +set_target_properties(tests-doc + PROPERTIES FOLDER "tests") -set_property(TARGET tests-doc PROPERTY FOLDER "tests") +add_test(NAME tests-doc COMMAND tests-doc) +add_dependencies(tests tests-doc) diff --git a/test/example/CMakeLists.txt b/test/example/CMakeLists.txt index 00d48e8ee7..33320b0df0 100644 --- a/test/example/CMakeLists.txt +++ b/test/example/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,4 +8,4 @@ # Official repository: https://github.com/boostorg/beast # -add_subdirectory (common) +add_subdirectory(common) diff --git a/test/example/common/CMakeLists.txt b/test/example/common/CMakeLists.txt index a2c6dfe131..8d679963a0 100644 --- a/test/example/common/CMakeLists.txt +++ b/test/example/common/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +# Copyright (c) 2024 Mohammad Nejati # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,25 +8,25 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources (include/boost/beast beast) -GroupSources (example/common common) -GroupSources (test/extras/include/boost/beast extras) -GroupSources (test/example/common "/") +add_executable(tests-example-common + Jamfile + root_certificates.cpp + server_certificate.cpp) -add_executable (tests-example-common - ${BOOST_BEAST_FILES} - ${COMMON_FILES} - ${EXTRAS_FILES} +source_group("" FILES Jamfile root_certificates.cpp - server_certificate.cpp -) + server_certificate.cpp) + +target_include_directories(tests-example-common + PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(tests-example-common - lib-asio lib-asio-ssl - lib-beast - lib-test - ) + lib-test) + +set_target_properties(tests-example-common + PROPERTIES FOLDER "tests") -set_property(TARGET tests-example-common PROPERTY FOLDER "tests") \ No newline at end of file +add_test(NAME tests-example-common COMMAND tests-example-common) +add_dependencies(tests tests-example-common) diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt index 99a87d6262..848d839df6 100644 --- a/test/fuzz/CMakeLists.txt +++ b/test/fuzz/CMakeLists.txt @@ -36,7 +36,6 @@ add_custom_target( WORKING_DIRECTORY ${BOOST_BEAST_FUZZER_SEEDS_PARENT_DIR} COMMENT "Unzipping fuzz seeds" VERBATIM) - set(BOOST_BEAST_FUZZER_CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/corpus) set(BOOST_BEAST_FUZZER_MERGED_CORPUS_DIR ${CMAKE_CURRENT_BINARY_DIR}/merged-corpus) if(EXISTS ${BOOST_BEAST_FUZZER_CORPUS_PATH}) @@ -54,6 +53,7 @@ else() COMMENT "Creating fuzz corpus directory" VERBATIM) endif() +set_target_properties(untar_corpus untar_seeds PROPERTIES FOLDER "fuzzing") add_dependencies(untar_corpus untar_seeds) # Target that runs all fuzz targets @@ -64,16 +64,18 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E tar cf ${BOOST_BEAST_FUZZER_CORPUS_PATH} ${BOOST_BEAST_FUZZER_CORPUS_DIR} WORKING_DIRECTORY ${BOOST_BEAST_FUZZER_CORPUS_PARENT_DIR} VERBATIM) + set_target_properties(boost_beast_fuzz_all PROPERTIES FOLDER "fuzzing") # Register a single fuzzer and add as dependency to fuzz target function(add_boost_beast_fuzzer NAME) # Fuzzer executable set(SOURCE_FILES ${ARGN}) add_executable(fuzzer_${NAME} ${SOURCE_FILES}) + source_group("" FILES ${SOURCE_FILES}) target_link_libraries(fuzzer_${NAME} PRIVATE lib-beast) target_compile_options(fuzzer_${NAME} PRIVATE -g -O2 -fsanitize=fuzzer,address,undefined -fno-sanitize-recover=undefined) target_link_libraries(fuzzer_${NAME} PRIVATE -fsanitize=fuzzer,address,undefined) - set_property(TARGET fuzzer_${NAME} PROPERTY FOLDER "fuzzing") + set_target_properties(fuzzer_${NAME} PROPERTIES FOLDER "fuzzing") # Custom target to run fuzzer executable add_custom_target( @@ -106,7 +108,14 @@ function(add_boost_beast_fuzzer NAME) DEPENDS untar_corpus fuzzer_${NAME}) add_dependencies(fuzz_${NAME} fuzzer_${NAME}) add_dependencies(boost_beast_fuzz_all fuzz_${NAME}) - set_property(TARGET fuzz_${NAME} PROPERTY ENVIRONMENT "UBSAN_OPTIONS=halt_on_error=false") + set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "UBSAN_OPTIONS=halt_on_error=false") + set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "fuzzing") + if (BOOST_BEAST_FUZZER_ADD_TO_CTEST) + add_test( + NAME test_fuzz_${NAME} + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target fuzz_${NAME}) + add_dependencies(tests test_fuzz_${NAME}) + endif() endfunction() # Register all fuzzers diff --git a/tools/coverage.sh b/tools/coverage.sh deleted file mode 100755 index 508e83d6bb..0000000000 --- a/tools/coverage.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/bash -set -e -lcov --directory bin.v2 --capture --no-external --directory $(pwd) --output-file coverage.info > /dev/null 2>&1 -lcov --extract coverage.info $(pwd)'/boost/beast/*' --output-file coverage.info > /dev/null -lcov --remove coverage.info $(pwd)'/boost/beast/_experimental/*' --output-file coverage.info > /dev/null -lcov --list coverage.info -# Codecov improperly detects project root in AzP, so we need to upload from beast git repo -cd libs/beast -curl -s https://codecov.io/bash -o codecov && bash ./codecov -X gcov -f ../../coverage.info -t $CODECOV_TOKEN diff --git a/tools/field.txt b/tools/field.txt deleted file mode 100644 index 2d6baf9964..0000000000 --- a/tools/field.txt +++ /dev/null @@ -1,356 +0,0 @@ -Accept -Accept-Additions -Accept-Charset -Accept-Datetime -Accept-Encoding -Accept-Features -Accept-Language -Accept-Patch -Accept-Post -Accept-Ranges -Access-Control -Access-Control-Allow-Credentials -Access-Control-Allow-Headers -Access-Control-Allow-Methods -Access-Control-Allow-Origin -Access-Control-Expose-Headers -Access-Control-Max-Age -Access-Control-Request-Headers -Access-Control-Request-Method -Age -A-IM -Allow -ALPN -Also-Control -Alternate-Recipient -Alternates -Alt-Svc -Alt-Used -Apparently-To -Apply-To-Redirect-Ref -Approved -Archive -Archived-At -Article-Names -Article-Updates -Authentication-Control -Authentication-Info -Authentication-Results -Authorization -Autoforwarded -Autosubmitted -Auto-Submitted -Base -Bcc -Body -Cache-Control -CalDAV-Timezones -Cancel-Key -Cancel-Lock -Cc -C-Ext -Close -C-Man -Comments -Compliance -Connection -Content-Alternative -Content-Base -Content-Description -Content-Disposition -Content-Duration -Content-Encoding -Content-features -Content-ID -Content-Identifier -Content-Language -Content-Length -Content-Location -Content-MD5 -Content-Range -Content-Return -Content-Script-Type -Content-Style-Type -Content-Transfer-Encoding -Content-Type -Content-Version -Control -Conversion -Conversion-With-Loss -Cookie -Cookie2 -C-Opt -Cost -C-PEP -C-PEP-Info -DASL -Date -Date-Received -DAV -Default-Style -Deferred-Delivery -Delivery-Date -Delta-Base -Depth -Derived-From -Destination -Differential-ID -Digest -Discarded-X400-IPMS-Extensions -Discarded-X400-MTS-Extensions -Disclose-Recipients -Disposition-Notification-Options -Disposition-Notification-To -Distribution -DKIM-Signature -DL-Expansion-History -Downgraded-Bcc -Downgraded-Cc -Downgraded-Disposition-Notification-To -Downgraded-Final-Recipient -Downgraded-From -Downgraded-In-Reply-To -Downgraded-Mail-From -Downgraded-Message-Id -Downgraded-Original-Recipient -Downgraded-Rcpt-To -Downgraded-References -Downgraded-Reply-To -Downgraded-Resent-Bcc -Downgraded-Resent-Cc -Downgraded-Resent-From -Downgraded-Resent-Reply-To -Downgraded-Resent-Sender -Downgraded-Resent-To -Downgraded-Return-Path -Downgraded-Sender -Downgraded-To -EDIINT-Features -Eesst-Version -Encoding -Encrypted -Errors-To -ETag -Expect -Expires -Expiry-Date -Ext -Followup-To -Forwarded -From -Generate-Delivery-Report -GetProfile -Hobareg -Host -HTTP2-Settings -If -If-Match -If-Modified-Since -If-None-Match -If-Range -If-Schedule-Tag-Match -If-Unmodified-Since -IM -Importance -Incomplete-Copy -Injection-Date -Injection-Info -In-Reply-To -Jabber-ID -Keep-Alive -Keywords -Label -Language -Last-Modified -Latest-Delivery-Time -Lines -Link -List-Archive -List-Help -List-ID -List-Owner -List-Post -List-Subscribe -List-Unsubscribe -List-Unsubscribe-Post -Location -Lock-Token -Man -Max-Forwards -Memento-Datetime -Message-Context -Message-ID -Message-Type -Meter -Method-Check -Method-Check-Expires -MIME-Version -MMHS-Acp127-Message-Identifier -MMHS-Authorizing-Users -MMHS-Codress-Message-Indicator -MMHS-Copy-Precedence -MMHS-Exempted-Address -MMHS-Extended-Authorisation-Info -MMHS-Handling-Instructions -MMHS-Message-Instructions -MMHS-Message-Type -MMHS-Originator-PLAD -MMHS-Originator-Reference -MMHS-Other-Recipients-Indicator-CC -MMHS-Other-Recipients-Indicator-To -MMHS-Primary-Precedence -MMHS-Subject-Indicator-Codes -MT-Priority -Negotiate -Newsgroups -NNTP-Posting-Date -NNTP-Posting-Host -Non-Compliance -Obsoletes -Opt -Optional -Optional-WWW-Authenticate -Ordering-Type -Organization -Origin -Original-Encoded-Information-Types -Original-From -Original-Message-ID -Original-Recipient -Original-Sender -Original-Subject -Originator-Return-Address -Overwrite -P3P -Path -PEP -Pep-Info -PICS-Label -Position -Posting-Version -Pragma -Prefer -Preference-Applied -Prevent-NonDelivery-Report -Priority -Privicon -ProfileObject -Protocol -Protocol-Info -Protocol-Query -Protocol-Request -Proxy-Authenticate -Proxy-Authentication-Info -Proxy-Authorization -Proxy-Connection -Proxy-Features -Proxy-Instruction -Public -Public-Key-Pins -Public-Key-Pins-Report-Only -Range -Received -Received-SPF -Redirect-Ref -References -Referer -Referer-Root -Relay-Version -Reply-By -Reply-To -Require-Recipient-Valid-Since -Resent-Bcc -Resent-Cc -Resent-Date -Resent-From -Resent-Message-ID -Resent-Reply-To -Resent-Sender -Resent-To -Resolution-Hint -Resolver-Location -Retry-After -Return-Path -Safe -Schedule-Reply -Schedule-Tag -Security-Scheme -Sec-Fetch-Dest -Sec-Fetch-Mode -Sec-Fetch-Site -Sec-Fetch-User -Sec-WebSocket-Accept -Sec-WebSocket-Extensions -Sec-WebSocket-Key -Sec-WebSocket-Protocol -Sec-WebSocket-Version -See-Also -Sender -Sensitivity -Server -Set-Cookie -Set-Cookie2 -SetProfile -SIO-Label -SIO-Label-History -SLUG -SoapAction -Solicitation -Status-URI -Strict-Transport-Security -Subject -SubOK -Subst -Summary -Supersedes -Surrogate-Capability -Surrogate-Control -TCN -TE -Timeout -Title -To -Topic -Trailer -Transfer-Encoding -TTL -UA-Color -UA-Media -UA-Pixels -UA-Resolution -UA-Windowpixels -Upgrade -Urgency -URI -User-Agent -Variant-Vary -Vary -VBR-Info -Version -Via -Want-Digest -Warning -WWW-Authenticate -X400-Content-Identifier -X400-Content-Return -X400-Content-Type -X400-MTS-Identifier -X400-Originator -X400-Received -X400-Recipients -X400-Trace -X-Archived-At -X-Device-Accept -X-Device-Accept-Charset -X-Device-Accept-Encoding -X-Device-Accept-Language -X-Device-User-Agent -X-Frame-Options -X-Mittente -X-PGP-Sig -Xref -X-Ricevuta -X-Riferimento-Message-ID -X-TipoRicevuta -X-Trasporto -X-VerificaSicurezza diff --git a/tools/install-dependencies.sh b/tools/install-dependencies.sh deleted file mode 100755 index e865187ba4..0000000000 --- a/tools/install-dependencies.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Exit if anything fails. -set -eux - -HERE=$PWD - -# Override gcc version to $GCC_VER. -# Put an appropriate symlink at the front of the path. -mkdir -pv $HOME/bin -for g in gcc g++ gcov gcc-ar gcc-nm gcc-ranlib -do - test -x $( type -p ${g}-$GCC_VER ) - ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g} -done - -if [[ -n ${CLANG_VER:-} ]]; then - # There are cases where the directory exists, but the exe is not available. - # Use this workaround for now. - if [[ ! -x llvm-${LLVM_VERSION}/bin/llvm-config ]] && [[ -d llvm-${LLVM_VERSION} ]]; then - rm -fr llvm-${LLVM_VERSION} - fi - if [[ ! -d llvm-${LLVM_VERSION} ]]; then - mkdir llvm-${LLVM_VERSION} - LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz" - wget -O - ${LLVM_URL} | tar -Jxvf - --strip 1 -C llvm-${LLVM_VERSION} - fi - llvm-${LLVM_VERSION}/bin/llvm-config --version; - export LLVM_CONFIG="llvm-${LLVM_VERSION}/bin/llvm-config"; -fi - -# NOTE, changed from PWD -> HOME -export PATH=$HOME/bin:$PATH - -# What versions are we ACTUALLY running? -if [ -x $HOME/bin/g++ ]; then - $HOME/bin/g++ -v -fi -if [ -x $HOME/bin/clang ]; then - $HOME/bin/clang -v -fi - -# Avoid `spurious errors` caused by ~/.npm permission issues -# Does it already exist? Who owns? What permissions? -ls -lah ~/.npm || mkdir ~/.npm - -# Make sure we own it -chown -Rc $USER ~/.npm diff --git a/tools/local-travis.sh b/tools/local-travis.sh deleted file mode 100755 index 8dd79da58e..0000000000 --- a/tools/local-travis.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -export VARIANT=ubasan -export TOOLSET=clang -export TRAVIS=0 -export BOOST_ROOT="`pwd`" - -"$1" diff --git a/tools/make_field.sh b/tools/make_field.sh deleted file mode 100755 index 8e54c13720..0000000000 --- a/tools/make_field.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -export LC_COLLATE=C - -echo "// string constants" -echo ' "",' -cat $1 | sort -f | uniq | sed 's/^/ \"/; s/$/\",/' -echo - -echo "enum class field : unsigned short" -echo "{" -echo " unknown = 0," -echo -#cat $1 | uniq | sort -f | sed 's/./\L&/g; s/^/\t/; s/$/,/' -cat $1 | sort -f | uniq | sed 's/\(.*\)/ \L\1,/; s/-/_/g' -echo "};" -echo - -echo "// pairs" -#cat $1 | uniq | sort -f | sed 's/\(.*\)/\tmatch\(field::\L\1, \"\E\1\"\);/; s/-/_/' -cat $1 | sort -f | uniq | perl -nE 'chomp; $a=lc($_); $a=~s/-/_/g; say " match(field::$a, \"$_\");";' | tr -d "\015" -