Skip to content

steve-downey/sender-examples

Repository files navigation

README

https://github.com/steve-downey/scratch/actions/workflows/ci.yml/badge.svg

1 Sender and Receiver Flow Control Examples

This repository contains examples of basic structured flow control using senders.

2 CMake Workflow – targets.mk

The targets.mk Makefile embodies the normal cmake workflow, making sure the build area is configured for a particular toolchain, compile is run after that, that tests are rebuilt and run after compiling, and so forth.

The Ninja multi-config generator is used, and several configs are created in the build area;

  • RelWithDebInfo
  • Debug
  • Tsan
  • Asan

The default build is RelWithDebInfo. Other options are selected by the CONFIG paramter.

make CONFIG=Asan

The top level Makefile is executable, and is symlinked as build, so equivalently

./build CONFIG=Asan

The build is done, by default, in ../cmake.bld/$(dirname)/build, controlled by the PROJECT variable.

Additional CMake flags can be supplied by CMAKE_FLAGS

3 Submodules

A few git submodules I find useful are linked in.

4 Docker

The workflow can be forwarded to a Docker image, instead of being built in the host system.

The target use-docker enables this by creating the flag file .use-docker

The base image can be created by using the definition in docker-inf/docker-cxx-dev/ with the Makefile provided.

The target docker-rebuild will create an image for this project, by default on the image steve-downey/cxx-dev:latest but can be overridden by setting BASE.

The targets in targets.mk can run in either the host or in a docker container. The targets in Makefile either help build or control that image, or forward to targets.mk.

About

Example code for C++Now talk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages