Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
99c43535
Commit
99c43535
authored
Nov 15, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up CMake setup, propagate flags via targets
parent
44c41ad2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
689 additions
and
694 deletions
+689
-694
CMakeLists.txt
CMakeLists.txt
+226
-124
cmake/build_config.hpp.in
cmake/build_config.hpp.in
+1
-20
examples/CMakeLists.txt
examples/CMakeLists.txt
+49
-49
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+307
-332
libcaf_core/src/invoke_message_result_strings.cpp
libcaf_core/src/invoke_message_result_strings.cpp
+0
-0
libcaf_io/CMakeLists.txt
libcaf_io/CMakeLists.txt
+78
-113
libcaf_openssl/CMakeLists.txt
libcaf_openssl/CMakeLists.txt
+25
-53
tools/CMakeLists.txt
tools/CMakeLists.txt
+3
-3
No files found.
CMakeLists.txt
View file @
99c43535
cmake_minimum_required
(
VERSION 3.
4
FATAL_ERROR
)
cmake_minimum_required
(
VERSION 3.
5...3.18
FATAL_ERROR
)
project
(
CAF CXX
)
cmake_policy
(
PUSH
)
cmake_policy
(
VERSION 3.5...3.18
)
# -- includes ------------------------------------------------------------------
include
(
CMakeDependentOption
)
# Conditional default values
include
(
CMakePackageConfigHelpers
)
# For creating .cmake files
include
(
CheckCXXSourceCompiles
)
# For checking whether some C++ features work
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
include
(
CMakeDependentOption
)
include
(
CMakePackageConfigHelpers
)
include
(
CheckCXXSourceCompiles
)
include
(
GNUInstallDirs
)
include
(
GenerateExportHeader
)
# -- override CMake defaults for internal cache entries ------------------------
...
...
@@ -77,67 +80,26 @@ if(MSVC AND CAF_SANITIZERS)
message
(
FATAL_ERROR
"Sanitizer builds are currently not supported on MSVC"
)
endif
()
# -- compiler setup ------------------------------------------------------------
# -- base target setup ---------------------------------------------------------
# This target propagates compiler flags, extra dependencies, etc. All other CAF
# targets pull this target in as PRIVATE dependency. Users that embed CAF into
# their own CMake scaffold (e.g., via FetchContent) may pass this target in with
# some properties predefined in order to force compiler flags or dependencies.
if
(
NOT TARGET caf_internal
)
add_library
(
caf_internal INTERFACE
)
endif
()
# Calls target_link_libraries for non-object library targets.
function
(
caf_target_link_libraries target access
)
get_target_property
(
targetType
${
target
}
TYPE
)
if
(
NOT targetType STREQUAL OBJECT_LIBRARY
)
target_
link_libraries
(
${
target
}
${
access
}
${
ARGN
}
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
target_compile_options
(
caf_internal INTERFACE -Wall -Wextra -pedantic
-ftemplate-depth=512 -ftemplate-backtrace-limit=0
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
target_
compile_options
(
caf_internal INTERFACE -Wdocumentation
)
else
()
# If we can't link against it, at least make sure to pull in INTERFACE
# includes and compiler options.
foreach
(
arg
${
ARGN
}
)
if
(
TARGET
${
arg
}
)
target_include_directories
(
${
target
}
PRIVATE
$<TARGET_PROPERTY:
${
arg
}
,INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_options
(
${
target
}
PRIVATE
$<TARGET_PROPERTY:
${
arg
}
,INTERFACE_COMPILE_OPTIONS>
)
endif
()
endforeach
()
target_compile_options
(
caf_internal INTERFACE
-Wno-missing-field-initializers
)
endif
()
endfunction
()
function
(
caf_set_default_properties
)
foreach
(
target
${
ARGN
}
)
if
(
MSVC
)
# Disable 4275 and 4251 (warnings regarding C++ classes at ABI boundaries).
target_compile_options
(
${
target
}
PRIVATE /wd4275 /wd4251
)
elseif
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
# Flags for both compilers.
target_compile_options
(
${
target
}
PRIVATE -Wall -Wextra -pedantic
-ftemplate-depth=512 -ftemplate-backtrace-limit=0
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
# Flags for Clang only.
target_compile_options
(
${
target
}
PRIVATE -Wdocumentation
)
else
()
# Flags for GCC only.
target_compile_options
(
${
target
}
PRIVATE
-Wno-missing-field-initializers
)
endif
()
endif
()
if
(
CAF_SANITIZERS
)
target_compile_options
(
${
target
}
PRIVATE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
caf_target_link_libraries
(
${
target
}
PRIVATE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
endif
()
# All of our object libraries can end up in shared libs => PIC.
get_target_property
(
targetType
${
target
}
TYPE
)
if
(
targetType STREQUAL OBJECT_LIBRARY
)
set_property
(
TARGET
${
target
}
PROPERTY POSITION_INDEPENDENT_CODE ON
)
endif
()
# We always place headers in the same directories and need to find generated
# headers from the bin dir.
target_include_directories
(
${
target
}
PRIVATE
"
${
CMAKE_BINARY_DIR
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
endforeach
()
endfunction
()
endif
()
# -- unit testing setup / caf_add_test_suites function ------------------------
...
...
@@ -183,59 +145,17 @@ if(NOT CMAKE_CROSSCOMPILING)
\n
Please see README.md for supported compilers.\
\n\n
try_compile output:
\n
${
cxx_check_output
}
"
)
endif
()
add_compile_options
(
"
${
cxx_flag
}
"
)
target_compile_options
(
caf_internal INTERFACE
"
${
cxx_flag
}
"
)
endif
()
endif
()
# --
set default visibility to hidden when building shared libs --------
--------
# --
export internal target (may be useful for re-using compiler flags)
--------
if
(
BUILD_SHARED_LIBS
)
set
(
CMAKE_CXX_VISIBILITY_PRESET hidden
)
set
(
CMAKE_VISIBILITY_INLINES_HIDDEN yes
)
cmake_policy
(
SET CMP0063 NEW
)
endif
()
set_target_properties
(
caf_internal PROPERTIES EXPORT_NAME internal
)
# -- utility targets -----------------------------------------------------------
add_library
(
CAF::internal ALIAS caf_internal
)
if
(
CAF_ENABLE_UTILITY_TARGETS
)
add_executable
(
caf-generate-enum-strings
EXCLUDE_FROM_ALL
cmake/caf-generate-enum-strings.cpp
)
add_custom_target
(
consistency-check
)
add_custom_target
(
update-enum-strings
)
# adds a consistency check that verifies that `cpp_file` is still valid by
# re-generating the file and comparing it to the existing file
function
(
caf_add_enum_consistency_check hpp_file cpp_file
)
set
(
input
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
hpp_file
}
"
)
set
(
file_under_test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
cpp_file
}
"
)
set
(
output
"
${
CMAKE_CURRENT_BINARY_DIR
}
/check/
${
cpp_file
}
"
)
get_filename_component
(
output_dir
"
${
output
}
"
DIRECTORY
)
file
(
MAKE_DIRECTORY
"
${
output_dir
}
"
)
add_custom_command
(
OUTPUT
"
${
output
}
"
COMMAND caf-generate-enum-strings
"
${
input
}
"
"
${
output
}
"
DEPENDS caf-generate-enum-strings
"
${
input
}
"
)
get_filename_component
(
target_name
"
${
input
}
"
NAME_WE
)
add_custom_target
(
"
${
target_name
}
"
COMMAND
"
${
CMAKE_COMMAND
}
"
"-Dfile_under_test=
${
file_under_test
}
"
"-Dgenerated_file=
${
output
}
"
-P
"
${
PROJECT_SOURCE_DIR
}
/cmake/check-consistency.cmake"
DEPENDS
"
${
output
}
"
)
add_dependencies
(
consistency-check
"
${
target_name
}
"
)
add_custom_target
(
"
${
target_name
}
-update"
COMMAND
caf-generate-enum-strings
"
${
input
}
"
"
${
file_under_test
}
"
DEPENDS caf-generate-enum-strings
"
${
input
}
"
)
add_dependencies
(
update-enum-strings
"
${
target_name
}
-update"
)
endfunction
()
else
()
function
(
caf_add_enum_consistency_check hpp_file cpp_file
)
# nop
endfunction
()
endif
()
install
(
TARGETS caf_internal EXPORT CAFTargets
)
# -- get CAF version -----------------------------------------------------------
...
...
@@ -259,12 +179,6 @@ else()
CACHE INTERNAL
"The version string used for shared library objects"
)
endif
()
# -- generate build config header ----------------------------------------------
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/cmake/build_config.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/caf/detail/build_config.hpp"
@ONLY
)
# -- install testing DSL headers -----------------------------------------------
add_library
(
libcaf_test INTERFACE
)
...
...
@@ -296,27 +210,67 @@ if(NOT TARGET uninstall)
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_CURRENT_BINARY_DIR
}
/uninstall.cmake
)
endif
()
# -- utility targets -----------------------------------------------------------
# -- utility function for installing library targets ---------------------------
if
(
CAF_ENABLE_UTILITY_TARGETS
)
add_executable
(
caf-generate-enum-strings
EXCLUDE_FROM_ALL
cmake/caf-generate-enum-strings.cpp
)
target_link_libraries
(
caf-generate-enum-strings PRIVATE CAF::internal
)
add_custom_target
(
consistency-check
)
add_custom_target
(
update-enum-strings
)
# adds a consistency check that verifies that `cpp_file` is still valid by
# re-generating the file and comparing it to the existing file
function
(
caf_add_enum_consistency_check hpp_file cpp_file
)
set
(
input
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
hpp_file
}
"
)
set
(
file_under_test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
cpp_file
}
"
)
set
(
output
"
${
CMAKE_CURRENT_BINARY_DIR
}
/check/
${
cpp_file
}
"
)
get_filename_component
(
output_dir
"
${
output
}
"
DIRECTORY
)
file
(
MAKE_DIRECTORY
"
${
output_dir
}
"
)
add_custom_command
(
OUTPUT
"
${
output
}
"
COMMAND caf-generate-enum-strings
"
${
input
}
"
"
${
output
}
"
DEPENDS caf-generate-enum-strings
"
${
input
}
"
)
get_filename_component
(
target_name
"
${
input
}
"
NAME_WE
)
add_custom_target
(
"
${
target_name
}
"
COMMAND
"
${
CMAKE_COMMAND
}
"
"-Dfile_under_test=
${
file_under_test
}
"
"-Dgenerated_file=
${
output
}
"
-P
"
${
PROJECT_SOURCE_DIR
}
/cmake/check-consistency.cmake"
DEPENDS
"
${
output
}
"
)
add_dependencies
(
consistency-check
"
${
target_name
}
"
)
add_custom_target
(
"
${
target_name
}
-update"
COMMAND
caf-generate-enum-strings
"
${
input
}
"
"
${
file_under_test
}
"
DEPENDS caf-generate-enum-strings
"
${
input
}
"
)
add_dependencies
(
update-enum-strings
"
${
target_name
}
-update"
)
endfunction
()
else
()
function
(
caf_add_enum_consistency_check hpp_file cpp_file
)
# nop
endfunction
()
endif
()
# -- utility functions ---------------------------------------------------------
function
(
caf_export_and_install_lib component
)
add_library
(
CAF::
${
component
}
ALIAS libcaf_
${
component
}
)
string
(
TOUPPER
"CAF_
${
component
}
_EXPORT"
export
MacroN
ame
)
string
(
TOUPPER
"CAF_
${
component
}
_EXPORT"
export
_macro_n
ame
)
target_include_directories
(
libcaf_
${
component
}
INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_
CURRENT_
BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
)
generate_export_header
(
libcaf_
${
component
}
EXPORT_MACRO_NAME
${
export
MacroN
ame
}
EXPORT_FILE_NAME
"
${
CMAKE_BINARY_DIR
}
/
caf/detail/
${
component
}
_export.hpp"
)
EXPORT_MACRO_NAME
${
export
_macro_n
ame
}
EXPORT_FILE_NAME
"caf/detail/
${
component
}
_export.hpp"
)
set_target_properties
(
libcaf_
${
component
}
PROPERTIES
EXPORT_NAME
${
component
}
SOVERSION
${
CAF_VERSION
}
VERSION
${
CAF_LIB_VERSION
}
OUTPUT_NAME caf_
${
component
}
)
install
(
FILES
"
${
CMAKE_BINARY_DIR
}
/caf/detail/
${
component
}
_export.hpp"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail"
)
install
(
TARGETS libcaf_
${
component
}
EXPORT CAFTargets
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
component
}
...
...
@@ -326,6 +280,125 @@ function(caf_export_and_install_lib component)
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
COMPONENT
${
component
}
FILES_MATCHING PATTERN
"*.hpp"
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/caf/detail/
${
component
}
_export.hpp"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail/"
)
endfunction
()
# TODO: remove when switching to CMake > 3.12
function
(
caf_target_link_libraries target
)
if
(
CMAKE_VERSION VERSION_LESS 3.12
)
get_target_property
(
target_type
${
target
}
TYPE
)
if
(
NOT target_type STREQUAL OBJECT_LIBRARY
)
target_link_libraries
(
${
target
}
${
ARGN
}
)
else
()
cmake_parse_arguments
(
CAF_TARGET_LINK_LIBRARIES
""
""
"PUBLIC;PRIVATE;INTERFACE"
${
ARGN
}
)
# If we can't link against it, at least make sure to pull in include paths
# and compiler options.
foreach
(
arg IN LISTS CAF_TARGET_LINK_LIBRARIES_PUBLIC
CAF_TARGET_LINK_LIBRARIES_PRIVATE
)
if
(
TARGET
${
arg
}
)
target_include_directories
(
${
target
}
PRIVATE
$<TARGET_PROPERTY:
${
arg
}
,INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_options
(
${
target
}
PRIVATE
$<TARGET_PROPERTY:
${
arg
}
,INTERFACE_COMPILE_OPTIONS>
)
endif
()
endforeach
()
endif
()
else
()
target_link_libraries
(
${
target
}
${
ARGN
}
)
endif
()
endfunction
()
# -- convenience function for automating our component setup -------------------
# Usage:
# caf_add_component(
# foo
# DEPENDENCIES
# INTERFACE
# ...
# PUBLIC
# ...
# PRIVATE
# ...
# HEADERS
# ...
# SOURCES
# ...
# TEST_SOURCES
# ...
# TEST_SUITES
# ...
# )
function
(
caf_add_component name
)
set
(
varargs DEPENDENCIES HEADERS SOURCES TEST_SOURCES TEST_SUITES
ENUM_CONSISTENCY_CHECKS
)
cmake_parse_arguments
(
CAF_ADD_COMPONENT
""
""
"
${
varargs
}
"
${
ARGN
}
)
if
(
NOT CAF_ADD_COMPONENT_HEADERS
)
message
(
FATAL_ERROR
"Cannot add CAF component without at least one header."
)
endif
()
if
(
NOT CAF_ADD_COMPONENT_SOURCES
)
message
(
FATAL_ERROR
"Cannot add CAF component without at least one source."
)
endif
()
foreach
(
param DEPENDENCIES HEADERS SOURCES
)
if
(
NOT CAF_ADD_COMPONENT_
${
param
}
)
message
(
FATAL_ERROR
"caf_add_component(): missing parameter
${
param
}
"
)
endif
()
endforeach
()
set
(
pub_lib_target
"libcaf_
${
name
}
"
)
set
(
obj_lib_target
"libcaf_
${
name
}
_obj"
)
set
(
tst_bin_target
"caf-
${
name
}
-test"
)
if
(
CAF_ENABLE_TESTING AND CAF_ADD_COMPONENT_TEST_SOURCES
)
set
(
targets
${
pub_lib_target
}
${
obj_lib_target
}
${
tst_bin_target
}
)
add_library
(
${
obj_lib_target
}
OBJECT
${
CAF_ADD_COMPONENT_HEADERS
}
${
CAF_ADD_COMPONENT_SOURCES
}
)
if
(
BUILD_SHARED_LIBS
)
set_property
(
TARGET
${
obj_lib_target
}
PROPERTY POSITION_INDEPENDENT_CODE ON
)
endif
()
caf_target_link_libraries
(
${
obj_lib_target
}
${
CAF_ADD_COMPONENT_DEPENDENCIES
}
)
add_library
(
${
pub_lib_target
}
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:
${
obj_lib_target
}
>
)
add_executable
(
${
tst_bin_target
}
${
CAF_ADD_COMPONENT_TEST_SOURCES
}
$<TARGET_OBJECTS:
${
obj_lib_target
}
>
)
target_link_libraries
(
${
tst_bin_target
}
PRIVATE CAF::test
${
CAF_ADD_COMPONENT_DEPENDENCIES
}
)
target_include_directories
(
${
tst_bin_target
}
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
if
(
CAF_ADD_COMPONENT_TEST_SUITES
)
caf_add_test_suites
(
${
tst_bin_target
}
${
CAF_ADD_COMPONENT_TEST_SUITES
}
)
endif
()
else
()
set
(
targets
${
pub_lib_target
}
)
add_library
(
${
pub_lib_target
}
${
CAF_ADD_COMPONENT_HEADERS
}
${
CAF_ADD_COMPONENT_SOURCES
}
)
endif
()
target_link_libraries
(
${
pub_lib_target
}
${
CAF_ADD_COMPONENT_DEPENDENCIES
}
)
foreach
(
target
${
targets
}
)
target_compile_definitions
(
${
target
}
PRIVATE
"libcaf_
${
name
}
_EXPORTS"
)
target_include_directories
(
${
target
}
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
if
(
BUILD_SHARED_LIBS
)
set_target_properties
(
${
target
}
PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
)
endif
()
endforeach
()
caf_export_and_install_lib
(
${
name
}
)
if
(
CAF_ADD_COMPONENT_ENUM_CONSISTENCY_CHECKS
)
foreach
(
enum_name
${
CAF_ADD_COMPONENT_ENUM_CONSISTENCY_CHECKS
}
)
string
(
REPLACE
"."
"/"
path
"
${
enum_name
}
"
)
caf_add_enum_consistency_check
(
"caf/
${
path
}
.hpp"
"src/
${
path
}
_strings.cpp"
)
endforeach
()
endif
()
endfunction
()
# -- build all components the user asked for -----------------------------------
...
...
@@ -348,6 +421,32 @@ if(CAF_ENABLE_TOOLS)
add_subdirectory
(
tools
)
endif
()
# -- add top-level compiler and linker flags that propagate to clients ---------
# Disable warnings regarding C++ classes at ABI boundaries on MSVC.
if
(
BUILD_SHARED_LIBS AND MSVC
)
target_compile_options
(
libcaf_core INTERFACE /wd4275 /wd4251
)
endif
()
# Propgatate sanitizer flags to downstream targets.
if
(
CAF_SANITIZERS
)
foreach
(
target caf_internal libcaf_core
)
target_compile_options
(
${
target
}
INTERFACE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
if
(
CMAKE_VERSION VERSION_GREATER_EQUAL 3.13
)
target_link_options
(
${
target
}
INTERFACE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
else
()
target_link_libraries
(
${
target
}
INTERFACE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
endif
()
endforeach
()
endif
()
# -- generate and install .cmake files -----------------------------------------
export
(
EXPORT CAFTargets FILE CAFTargets.cmake NAMESPACE CAF::
)
...
...
@@ -373,6 +472,7 @@ install(
DESTINATION
"
${
CAF_INSTALL_CMAKEDIR
}
"
)
# -- extra file output (primarily for CAF CI) ----------------------------------
if
(
CAF_BUILD_INFO_FILE_PATH
)
...
...
@@ -380,3 +480,5 @@ if(CAF_BUILD_INFO_FILE_PATH)
"
${
CAF_BUILD_INFO_FILE_PATH
}
"
@ONLY
)
endif
()
cmake_policy
(
POP
)
cmake/build_config.hpp.in
View file @
99c43535
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright (C) 2011 - 2016 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
// this header is auto-generated by CMake
#pragma once
#include "caf/detail/log_level.hpp"
// this header is auto-generated by CMake
#define CAF_LOG_LEVEL CAF_LOG_LEVEL_@CAF_LOG_LEVEL@
#cmakedefine CAF_ENABLE_RUNTIME_CHECKS
...
...
examples/CMakeLists.txt
View file @
99c43535
...
...
@@ -2,13 +2,14 @@ add_custom_target(all_examples)
function
(
add_example folder name
)
add_executable
(
${
name
}
${
folder
}
/
${
name
}
.cpp
${
ARGN
}
)
install
(
FILES
${
folder
}
/
${
name
}
.cpp DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/caf/examples/
${
folder
}
)
install
(
FILES
${
folder
}
/
${
name
}
.cpp
DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/caf/examples/
${
folder
}
)
add_dependencies
(
${
name
}
all_examples
)
endfunction
()
function
(
add_core_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::core
)
target_link_libraries
(
${
name
}
PRIVATE CAF::internal
CAF::core
)
endfunction
()
# -- examples for CAF::core ----------------------------------------------------
...
...
@@ -43,7 +44,7 @@ add_core_example(custom_type custom_types_3)
# testing DSL
add_example
(
testing ping_pong
)
target_link_libraries
(
ping_pong CAF::core CAF::test
)
target_link_libraries
(
ping_pong
PRIVATE CAF::internal
CAF::core CAF::test
)
# -- examples for CAF::io ------------------------------------------------------
...
...
@@ -52,7 +53,7 @@ if(TARGET CAF::io)
function
(
add_io_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::io CAF::core
)
target_link_libraries
(
${
name
}
PRIVATE CAF::internal CAF::io
)
endfunction
()
# basic remoting
...
...
@@ -65,53 +66,52 @@ if(TARGET CAF::io)
add_io_example
(
broker simple_broker
)
add_io_example
(
broker simple_http_broker
)
endif
()
if
(
CAF_ENABLE_PROTOBUF_EXAMPLES
)
find_package
(
Protobuf REQUIRED
)
if
(
NOT PROTOBUF_PROTOC_EXECUTABLE
)
message
(
FATAL_ERROR
"CMake was unable to set PROTOBUF_PROTOC_EXECUTABLE"
)
endif
()
protobuf_generate_cpp
(
ProtoSources ProtoHeaders
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/remoting/pingpong.proto"
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
protobuf_broker broker/protobuf_broker.cpp
${
ProtoSources
}
)
target_link_libraries
(
protobuf_broker
PRIVATE
${
PROTOBUF_LIBRARIES
}
CAF::internal CAF::io
)
add_dependencies
(
protobuf_broker all_examples
)
endif
()
if
(
CAF_ENABLE_PROTOBUF_EXAMPLES
)
find_package
(
Protobuf REQUIRED
)
if
(
NOT PROTOBUF_PROTOC_EXECUTABLE
)
message
(
FATAL_ERROR
"CMake was unable to set PROTOBUF_PROTOC_EXECUTABLE"
)
if
(
CAF_ENABLE_QT5_EXAMPLES
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets REQUIRED
)
message
(
STATUS
"Found Qt5"
)
#include(${QT_USE_FILE})
QT5_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
QT5_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
QT5_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
include_directories
(
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
${
Qt5Core_INCLUDE_DIRS
}
${
Qt5Gui_INCLUDE_DIRS
}
${
Qt5Widgets_INCLUDE_DIRS
}
)
set
(
GROUP_CHAT_SRC qtsupport/qt_group_chat.cpp qtsupport/chatwidget.cpp
)
add_executable
(
qt_group_chat
${
GROUP_CHAT_SRC
}
${
GROUP_CHAT_MOC_SRC
}
${
GROUP_CHAT_UI_HDR
}
)
target_link_libraries
(
qt_group_chat
Qt5::Core
Qt5::Gui
Qt5::Widgets
CAF::io
)
add_dependencies
(
qt_group_chat all_examples
)
endif
()
protobuf_generate_cpp
(
ProtoSources ProtoHeaders
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/remoting/pingpong.proto"
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
protobuf_broker broker/protobuf_broker.cpp
${
ProtoSources
}
)
target_link_libraries
(
protobuf_broker
${
PROTOBUF_LIBRARIES
}
CAF::core CAF::io
)
add_dependencies
(
protobuf_broker all_examples
)
endif
()
if
(
CAF_ENABLE_QT5_EXAMPLES
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets REQUIRED
)
message
(
STATUS
"Found Qt5"
)
#include(${QT_USE_FILE})
QT5_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
QT5_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
QT5_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
include_directories
(
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
${
Qt5Core_INCLUDE_DIRS
}
${
Qt5Gui_INCLUDE_DIRS
}
${
Qt5Widgets_INCLUDE_DIRS
}
)
set
(
GROUP_CHAT_SRC qtsupport/qt_group_chat.cpp qtsupport/chatwidget.cpp
)
add_executable
(
qt_group_chat
${
GROUP_CHAT_SRC
}
${
GROUP_CHAT_MOC_SRC
}
${
GROUP_CHAT_UI_HDR
}
)
target_link_libraries
(
qt_group_chat
Qt5::Core
Qt5::Gui
Qt5::Widgets
CAF::core
CAF::io
)
add_dependencies
(
qt_group_chat all_examples
)
endif
()
if
(
CAF_ENABLE_CURL_EXAMPLES
)
find_package
(
CURL REQUIRED
)
add_executable
(
curl_fuse curl/curl_fuse.cpp
)
include_directories
(
${
CURL_INCLUDE_DIRS
}
)
target_link_libraries
(
curl_fuse
${
CURL_LIBRARY
}
CAF::io
)
add_dependencies
(
curl_fuse all_examples
)
endif
()
if
(
CAF_ENABLE_CURL_EXAMPLES
)
find_package
(
CURL REQUIRED
)
add_executable
(
curl_fuse curl/curl_fuse.cpp
)
include_directories
(
${
CURL_INCLUDE_DIRS
}
)
target_link_libraries
(
curl_fuse
${
CURL_LIBRARY
}
CAF::core CAF::io
)
add_dependencies
(
curl_fuse all_examples
)
endif
()
libcaf_core/CMakeLists.txt
View file @
99c43535
# --
get header files for creating "proper" XCode projects
---------------------
# --
collect header files ---------------------------------
---------------------
file
(
GLOB_RECURSE CAF_CORE_HEADERS
"caf/*.hpp"
)
# -- add consistency checks for enum to_string implementations -----------------
caf_add_enum_consistency_check
(
"caf/sec.hpp"
"src/sec_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/pec.hpp"
"src/pec_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/stream_priority.hpp"
"src/stream_priority_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/exit_reason.hpp"
"src/exit_reason_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/invoke_message_result.hpp"
"src/invoke_msg_result_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/message_priority.hpp"
"src/message_priority_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/intrusive/inbox_result.hpp"
"src/intrusive/inbox_result_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/intrusive/task_result.hpp"
"src/intrusive/task_result_strings.cpp"
)
# -- dependencies --------------------------------------------------------------
if
(
NOT TARGET Threads::Threads
)
find_package
(
Threads REQUIRED
)
endif
()
# -- utility function for setting default properties ---------------------------
function
(
caf_core_set_default_properties
)
foreach
(
target
${
ARGN
}
)
# Set global defaults and set EXPORTS flag.
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_core_EXPORTS
)
# Pull in public dependencies.
caf_target_link_libraries
(
${
target
}
PUBLIC Threads::Threads
)
if
(
MSVC
)
caf_target_link_libraries
(
${
target
}
PUBLIC iphlpapi
)
endif
()
endforeach
()
endfunction
()
# -- add library target --------------------------------------------------------
add_library
(
libcaf_core_obj OBJECT
${
CAF_CORE_HEADERS
}
src/abstract_actor.cpp
src/abstract_channel.cpp
src/abstract_group.cpp
src/actor.cpp
src/actor_addr.cpp
src/actor_clock.cpp
src/actor_companion.cpp
src/actor_config.cpp
src/actor_control_block.cpp
src/actor_ostream.cpp
src/actor_pool.cpp
src/actor_profiler.cpp
src/actor_proxy.cpp
src/actor_registry.cpp
src/actor_system.cpp
src/actor_system_config.cpp
src/attachable.cpp
src/behavior.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/blocking_actor.cpp
src/config_option.cpp
src/config_option_adder.cpp
src/config_option_set.cpp
src/config_value.cpp
src/config_value_reader.cpp
src/config_value_writer.cpp
src/credit_controller.cpp
src/decorator/sequencer.cpp
src/default_attachable.cpp
src/deserializer.cpp
src/detail/abstract_worker.cpp
src/detail/abstract_worker_hub.cpp
src/detail/append_percent_encoded.cpp
src/detail/behavior_impl.cpp
src/detail/behavior_stack.cpp
src/detail/blocking_behavior.cpp
src/detail/config_consumer.cpp
src/detail/encode_base64.cpp
src/detail/get_mac_addresses.cpp
src/detail/get_process_id.cpp
src/detail/get_root_uuid.cpp
src/detail/glob_match.cpp
src/detail/group_tunnel.cpp
src/detail/invoke_result_visitor.cpp
src/detail/local_group_module.cpp
src/detail/message_builder_element.cpp
src/detail/message_data.cpp
src/detail/meta_object.cpp
src/detail/parse.cpp
src/detail/parser/chars.cpp
src/detail/pretty_type_name.cpp
src/detail/print.cpp
src/detail/private_thread.cpp
src/detail/ripemd_160.cpp
src/detail/serialized_size.cpp
src/detail/set_thread_name.cpp
src/detail/shared_spinlock.cpp
src/detail/simple_actor_clock.cpp
src/detail/size_based_credit_controller.cpp
src/detail/stringification_inspector.cpp
src/detail/sync_request_bouncer.cpp
src/detail/test_actor_clock.cpp
src/detail/thread_safe_actor_clock.cpp
src/detail/tick_emitter.cpp
src/detail/token_based_credit_controller.cpp
src/detail/type_id_list_builder.cpp
src/downstream_manager.cpp
src/downstream_manager_base.cpp
src/error.cpp
src/event_based_actor.cpp
src/execution_unit.cpp
src/exit_reason_strings.cpp
src/forwarding_actor_proxy.cpp
src/group.cpp
src/group_manager.cpp
src/group_module.cpp
src/hash/sha1.cpp
src/inbound_path.cpp
src/init_global_meta_objects.cpp
src/intrusive/inbox_result_strings.cpp
src/intrusive/task_result_strings.cpp
src/invoke_msg_result_strings.cpp
src/ipv4_address.cpp
src/ipv4_endpoint.cpp
src/ipv4_subnet.cpp
src/ipv6_address.cpp
src/ipv6_endpoint.cpp
src/ipv6_subnet.cpp
src/load_inspector.cpp
src/local_actor.cpp
src/logger.cpp
src/mailbox_element.cpp
src/make_config_option.cpp
src/memory_managed.cpp
src/message.cpp
src/message_builder.cpp
src/message_handler.cpp
src/message_priority_strings.cpp
src/monitorable_actor.cpp
src/node_id.cpp
src/outbound_path.cpp
src/pec_strings.cpp
src/policy/downstream_messages.cpp
src/policy/unprofiled.cpp
src/policy/work_sharing.cpp
src/policy/work_stealing.cpp
src/proxy_registry.cpp
src/raise_error.cpp
src/ref_counted.cpp
src/replies_to.cpp
src/response_promise.cpp
src/resumable.cpp
src/save_inspector.cpp
src/scheduled_actor.cpp
src/scheduler/abstract_coordinator.cpp
src/scheduler/test_coordinator.cpp
src/scoped_actor.cpp
src/scoped_execution_unit.cpp
src/sec_strings.cpp
src/serializer.cpp
src/settings.cpp
src/skip.cpp
src/stream_aborter.cpp
src/stream_manager.cpp
src/stream_priority_strings.cpp
src/string_algorithms.cpp
src/string_view.cpp
src/telemetry/collector/prometheus.cpp
src/telemetry/label.cpp
src/telemetry/label_view.cpp
src/telemetry/metric.cpp
src/telemetry/metric_family.cpp
src/telemetry/metric_registry.cpp
src/term.cpp
src/thread_hook.cpp
src/timestamp.cpp
src/tracing_data.cpp
src/tracing_data_factory.cpp
src/type_id.cpp
src/type_id_list.cpp
src/uri.cpp
src/uri_builder.cpp
src/uuid.cpp
)
add_library
(
libcaf_core
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_core_obj>
)
caf_core_set_default_properties
(
libcaf_core_obj libcaf_core
)
caf_export_and_install_lib
(
core
)
install
(
FILES
"
${
CMAKE_BINARY_DIR
}
/caf/detail/build_config.hpp"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail"
)
set
(
LIBCAF_CORE_OPTIONAL_DEPENDENCIES
""
)
# Check whether we need to link against libatomic.
if
(
NOT CMAKE_CROSSCOMPILING
)
...
...
@@ -213,157 +25,320 @@ if(NOT CMAKE_CROSSCOMPILING)
if
(
NOT has_64bit_atomic_with_libatomic
)
message
(
FATAL_ERROR
"Unable to compile code with std::atomic<uint64_t>"
)
endif
()
target_link_libraries
(
libcaf_core INTERFACE
atomic
)
list
(
APPEND LIBCAF_CORE_OPTIONAL_DEPENDENCIES
atomic
)
endif
()
endif
()
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_ENABLE_TESTING
)
return
()
if
(
MSVC
)
list
(
APPEND LIBCAF_CORE_OPTIONAL_DEPENDENCIES iphlpapi
)
endif
()
add_executable
(
caf-core-test
test/core-test.cpp
test/nasty.cpp
$<TARGET_OBJECTS:libcaf_core_obj>
)
# -- generated files -----------------------------------------------------------
caf_core_set_default_properties
(
caf-core-test
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/cmake/build_config.hpp.in"
"caf/detail/build_config.hpp"
@ONLY
)
target_include_directories
(
caf-core-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
"
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/caf/detail/build_config.hpp"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail/
"
)
target_link_libraries
(
caf-core-test PUBLIC CAF::test
)
# -- add targets ---------------------------------------------------------------
caf_add_test_suites
(
caf-core-test
actor_clock
actor_factory
actor_lifetime
actor_pool
actor_profiler
actor_registry
actor_system_config
actor_termination
aout
behavior
binary_deserializer
binary_serializer
blocking_actor
broadcast_downstream_manager
byte
composition
config_option
config_option_set
config_value
config_value_reader
config_value_writer
const_typed_message_view
constructor_attach
continuous_streaming
cow_tuple
decorator.sequencer
deep_to_string
detached_actors
detail.bounds_checker
detail.config_consumer
detail.encode_base64
detail.group_tunnel
detail.ieee_754
detail.limited_vector
detail.local_group_module
detail.meta_object
detail.parse
detail.parser.read_bool
detail.parser.read_config
detail.parser.read_floating_point
detail.parser.read_number
detail.parser.read_number_or_timespan
detail.parser.read_signed_integer
detail.parser.read_string
detail.parser.read_timespan
detail.parser.read_unsigned_integer
detail.ringbuffer
detail.ripemd_160
detail.serialized_size
detail.tick_emitter
detail.type_id_list_builder
detail.unique_function
detail.unordered_flat_map
dictionary
dynamic_spawn
error
expected
function_view
fused_downstream_manager
handles
hash.fnv
hash.sha1
intrusive.drr_cached_queue
intrusive.drr_queue
intrusive.fifo_inbox
intrusive.lifo_inbox
intrusive.task_queue
intrusive.wdrr_dynamic_multiplexed_queue
intrusive.wdrr_fixed_multiplexed_queue
intrusive_ptr
ipv4_address
ipv4_endpoint
ipv4_subnet
ipv6_address
ipv6_endpoint
ipv6_subnet
load_inspector
logger
mailbox_element
message
message_builder
message_id
message_lifetime
metaprogramming
mixin.requester
mixin.sender
mock_streaming_classes
native_streaming_classes
node_id
optional
or_else
pipeline_streaming
policy.categorized
policy.select_all
policy.select_any
request_timeout
result
save_inspector
selective_streaming
serial_reply
serialization
settings
simple_timeout
span
stateful_actor
string_algorithms
string_view
sum_type
telemetry.collector.prometheus
telemetry.counter
telemetry.gauge
telemetry.histogram
telemetry.label
telemetry.metric_registry
telemetry.timer
thread_hook
tracing_data
type_id_list
typed_behavior
typed_message_view
typed_response_promise
typed_spawn
unit
uri
uuid
variant
)
caf_add_component
(
core
DEPENDENCIES
PUBLIC
Threads::Threads
${
LIBCAF_CORE_OPTIONAL_DEPENDENCIES
}
PRIVATE
CAF::internal
ENUM_CONSISTENCY_CHECKS
exit_reason
intrusive.inbox_result
intrusive.task_result
invoke_message_result
message_priority
pec
sec
stream_priority
HEADERS
${
CAF_CORE_HEADERS
}
SOURCES
src/abstract_actor.cpp
src/abstract_channel.cpp
src/abstract_group.cpp
src/actor.cpp
src/actor_addr.cpp
src/actor_clock.cpp
src/actor_companion.cpp
src/actor_config.cpp
src/actor_control_block.cpp
src/actor_ostream.cpp
src/actor_pool.cpp
src/actor_profiler.cpp
src/actor_proxy.cpp
src/actor_registry.cpp
src/actor_system.cpp
src/actor_system_config.cpp
src/attachable.cpp
src/behavior.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/blocking_actor.cpp
src/config_option.cpp
src/config_option_adder.cpp
src/config_option_set.cpp
src/config_value.cpp
src/config_value_reader.cpp
src/config_value_writer.cpp
src/credit_controller.cpp
src/decorator/sequencer.cpp
src/default_attachable.cpp
src/deserializer.cpp
src/detail/abstract_worker.cpp
src/detail/abstract_worker_hub.cpp
src/detail/append_percent_encoded.cpp
src/detail/behavior_impl.cpp
src/detail/behavior_stack.cpp
src/detail/blocking_behavior.cpp
src/detail/config_consumer.cpp
src/detail/encode_base64.cpp
src/detail/get_mac_addresses.cpp
src/detail/get_process_id.cpp
src/detail/get_root_uuid.cpp
src/detail/glob_match.cpp
src/detail/group_tunnel.cpp
src/detail/invoke_result_visitor.cpp
src/detail/local_group_module.cpp
src/detail/message_builder_element.cpp
src/detail/message_data.cpp
src/detail/meta_object.cpp
src/detail/parse.cpp
src/detail/parser/chars.cpp
src/detail/pretty_type_name.cpp
src/detail/print.cpp
src/detail/private_thread.cpp
src/detail/ripemd_160.cpp
src/detail/serialized_size.cpp
src/detail/set_thread_name.cpp
src/detail/shared_spinlock.cpp
src/detail/simple_actor_clock.cpp
src/detail/size_based_credit_controller.cpp
src/detail/stringification_inspector.cpp
src/detail/sync_request_bouncer.cpp
src/detail/test_actor_clock.cpp
src/detail/thread_safe_actor_clock.cpp
src/detail/tick_emitter.cpp
src/detail/token_based_credit_controller.cpp
src/detail/type_id_list_builder.cpp
src/downstream_manager.cpp
src/downstream_manager_base.cpp
src/error.cpp
src/event_based_actor.cpp
src/execution_unit.cpp
src/exit_reason_strings.cpp
src/forwarding_actor_proxy.cpp
src/group.cpp
src/group_manager.cpp
src/group_module.cpp
src/hash/sha1.cpp
src/inbound_path.cpp
src/init_global_meta_objects.cpp
src/intrusive/inbox_result_strings.cpp
src/intrusive/task_result_strings.cpp
src/invoke_message_result_strings.cpp
src/ipv4_address.cpp
src/ipv4_endpoint.cpp
src/ipv4_subnet.cpp
src/ipv6_address.cpp
src/ipv6_endpoint.cpp
src/ipv6_subnet.cpp
src/load_inspector.cpp
src/local_actor.cpp
src/logger.cpp
src/mailbox_element.cpp
src/make_config_option.cpp
src/memory_managed.cpp
src/message.cpp
src/message_builder.cpp
src/message_handler.cpp
src/message_priority_strings.cpp
src/monitorable_actor.cpp
src/node_id.cpp
src/outbound_path.cpp
src/pec_strings.cpp
src/policy/downstream_messages.cpp
src/policy/unprofiled.cpp
src/policy/work_sharing.cpp
src/policy/work_stealing.cpp
src/proxy_registry.cpp
src/raise_error.cpp
src/ref_counted.cpp
src/replies_to.cpp
src/response_promise.cpp
src/resumable.cpp
src/save_inspector.cpp
src/scheduled_actor.cpp
src/scheduler/abstract_coordinator.cpp
src/scheduler/test_coordinator.cpp
src/scoped_actor.cpp
src/scoped_execution_unit.cpp
src/sec_strings.cpp
src/serializer.cpp
src/settings.cpp
src/skip.cpp
src/stream_aborter.cpp
src/stream_manager.cpp
src/stream_priority_strings.cpp
src/string_algorithms.cpp
src/string_view.cpp
src/telemetry/collector/prometheus.cpp
src/telemetry/label.cpp
src/telemetry/label_view.cpp
src/telemetry/metric.cpp
src/telemetry/metric_family.cpp
src/telemetry/metric_registry.cpp
src/term.cpp
src/thread_hook.cpp
src/timestamp.cpp
src/tracing_data.cpp
src/tracing_data_factory.cpp
src/type_id.cpp
src/type_id_list.cpp
src/uri.cpp
src/uri_builder.cpp
src/uuid.cpp
TEST_SOURCES
test/core-test.cpp
test/nasty.cpp
TEST_SUITES
actor_clock
actor_factory
actor_lifetime
actor_pool
actor_profiler
actor_registry
actor_system_config
actor_termination
aout
behavior
binary_deserializer
binary_serializer
blocking_actor
broadcast_downstream_manager
byte
composition
config_option
config_option_set
config_value
config_value_reader
config_value_writer
const_typed_message_view
constructor_attach
continuous_streaming
cow_tuple
decorator.sequencer
deep_to_string
detached_actors
detail.bounds_checker
detail.config_consumer
detail.encode_base64
detail.group_tunnel
detail.ieee_754
detail.limited_vector
detail.local_group_module
detail.meta_object
detail.parse
detail.parser.read_bool
detail.parser.read_config
detail.parser.read_floating_point
detail.parser.read_number
detail.parser.read_number_or_timespan
detail.parser.read_signed_integer
detail.parser.read_string
detail.parser.read_timespan
detail.parser.read_unsigned_integer
detail.ringbuffer
detail.ripemd_160
detail.serialized_size
detail.tick_emitter
detail.type_id_list_builder
detail.unique_function
detail.unordered_flat_map
dictionary
dynamic_spawn
error
expected
function_view
fused_downstream_manager
handles
hash.fnv
hash.sha1
intrusive.drr_cached_queue
intrusive.drr_queue
intrusive.fifo_inbox
intrusive.lifo_inbox
intrusive.task_queue
intrusive.wdrr_dynamic_multiplexed_queue
intrusive.wdrr_fixed_multiplexed_queue
intrusive_ptr
ipv4_address
ipv4_endpoint
ipv4_subnet
ipv6_address
ipv6_endpoint
ipv6_subnet
load_inspector
logger
mailbox_element
message
message_builder
message_id
message_lifetime
metaprogramming
mixin.requester
mixin.sender
mock_streaming_classes
native_streaming_classes
node_id
optional
or_else
pipeline_streaming
policy.categorized
policy.select_all
policy.select_any
request_timeout
result
save_inspector
selective_streaming
serial_reply
serialization
settings
simple_timeout
span
stateful_actor
string_algorithms
string_view
sum_type
telemetry.collector.prometheus
telemetry.counter
telemetry.gauge
telemetry.histogram
telemetry.label
telemetry.metric_registry
telemetry.timer
thread_hook
tracing_data
type_id_list
typed_behavior
typed_message_view
typed_response_promise
typed_spawn
unit
uri
uuid
variant
)
if
(
CAF_ENABLE_EXCEPTIONS
)
if
(
CAF_ENABLE_
TESTING AND CAF_ENABLE_
EXCEPTIONS
)
caf_add_test_suites
(
caf-core-test custom_exception_handler
)
endif
()
libcaf_core/src/invoke_m
sg
_result_strings.cpp
→
libcaf_core/src/invoke_m
essage
_result_strings.cpp
View file @
99c43535
File moved
libcaf_io/CMakeLists.txt
View file @
99c43535
# --
get header files for creating "proper" XCode projects
---------------------
# --
collect header files ---------------------------------
---------------------
file
(
GLOB_RECURSE CAF_IO_HEADERS
"caf/*.hpp"
)
# -- add consistency checks for enum to_string implementations -----------------
caf_add_enum_consistency_check
(
"caf/io/basp/message_type.hpp"
"src/io/basp/message_type_strings.cpp"
)
caf_add_enum_consistency_check
(
"caf/io/network/operation.hpp"
"src/io/network/operation_strings.cpp"
)
# -- utility function for setting default properties ---------------------------
function
(
caf_io_set_default_properties
)
foreach
(
target
${
ARGN
}
)
# Set global defaults and set EXPORTS flag.
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_io_EXPORTS
)
# Pull in public dependencies.
caf_target_link_libraries
(
${
target
}
PUBLIC CAF::core
)
if
(
MSVC
)
caf_target_link_libraries
(
${
target
}
PUBLIC ws2_32 iphlpapi
)
endif
()
endforeach
()
endfunction
()
# -- add library target --------------------------------------------------------
add_library
(
libcaf_io_obj OBJECT
${
CAF_IO_HEADERS
}
src/detail/prometheus_broker.cpp
src/detail/remote_group_module.cpp
src/detail/socket_guard.cpp
src/io/abstract_broker.cpp
src/io/basp/header.cpp
src/io/basp/instance.cpp
src/io/basp/message_queue.cpp
src/io/basp/message_type_strings.cpp
src/io/basp/routing_table.cpp
src/io/basp/worker.cpp
src/io/basp_broker.cpp
src/io/broker.cpp
src/io/connection_helper.cpp
src/io/datagram_servant.cpp
src/io/doorman.cpp
src/io/middleman.cpp
src/io/middleman_actor.cpp
src/io/middleman_actor_impl.cpp
src/io/network/acceptor.cpp
src/io/network/acceptor_manager.cpp
src/io/network/datagram_handler.cpp
src/io/network/datagram_manager.cpp
src/io/network/datagram_servant_impl.cpp
src/io/network/default_multiplexer.cpp
src/io/network/doorman_impl.cpp
src/io/network/event_handler.cpp
src/io/network/interfaces.cpp
src/io/network/ip_endpoint.cpp
src/io/network/manager.cpp
src/io/network/multiplexer.cpp
src/io/network/native_socket.cpp
src/io/network/operation_strings.cpp
src/io/network/pipe_reader.cpp
src/io/network/protocol.cpp
src/io/network/receive_buffer.cpp
src/io/network/scribe_impl.cpp
src/io/network/stream.cpp
src/io/network/stream_manager.cpp
src/io/network/test_multiplexer.cpp
src/io/scribe.cpp
src/policy/tcp.cpp
src/policy/udp.cpp
)
add_library
(
libcaf_io
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_io_obj>
)
caf_io_set_default_properties
(
libcaf_io_obj libcaf_io
)
caf_export_and_install_lib
(
io
)
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_ENABLE_TESTING
)
return
()
endif
()
add_executable
(
caf-io-test
test/io-test.cpp
$<TARGET_OBJECTS:libcaf_io_obj>
)
caf_io_set_default_properties
(
caf-io-test
)
target_include_directories
(
caf-io-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_link_libraries
(
caf-io-test PRIVATE CAF::test
)
caf_add_test_suites
(
caf-io-test
detail.prometheus_broker
io.basp.message_queue
io.basp_broker
io.broker
io.http_broker
io.monitor
io.network.default_multiplexer
io.network.ip_endpoint
io.receive_buffer
io.remote_actor
io.remote_group
io.remote_spawn
io.unpublish
io.worker
)
if
(
NOT WIN32
)
# -- add targets ---------------------------------------------------------------
caf_add_component
(
io
DEPENDENCIES
PUBLIC
CAF::core
$<$<CXX_COMPILER_ID:MSVC>:ws2_32>
PRIVATE
CAF::internal
ENUM_CONSISTENCY_CHECKS
io.basp.message_type
io.network.operation
HEADERS
${
CAF_IO_HEADERS
}
SOURCES
src/detail/prometheus_broker.cpp
src/detail/remote_group_module.cpp
src/detail/socket_guard.cpp
src/io/abstract_broker.cpp
src/io/basp/header.cpp
src/io/basp/instance.cpp
src/io/basp/message_queue.cpp
src/io/basp/message_type_strings.cpp
src/io/basp/routing_table.cpp
src/io/basp/worker.cpp
src/io/basp_broker.cpp
src/io/broker.cpp
src/io/connection_helper.cpp
src/io/datagram_servant.cpp
src/io/doorman.cpp
src/io/middleman.cpp
src/io/middleman_actor.cpp
src/io/middleman_actor_impl.cpp
src/io/network/acceptor.cpp
src/io/network/acceptor_manager.cpp
src/io/network/datagram_handler.cpp
src/io/network/datagram_manager.cpp
src/io/network/datagram_servant_impl.cpp
src/io/network/default_multiplexer.cpp
src/io/network/doorman_impl.cpp
src/io/network/event_handler.cpp
src/io/network/interfaces.cpp
src/io/network/ip_endpoint.cpp
src/io/network/manager.cpp
src/io/network/multiplexer.cpp
src/io/network/native_socket.cpp
src/io/network/operation_strings.cpp
src/io/network/pipe_reader.cpp
src/io/network/protocol.cpp
src/io/network/receive_buffer.cpp
src/io/network/scribe_impl.cpp
src/io/network/stream.cpp
src/io/network/stream_manager.cpp
src/io/network/test_multiplexer.cpp
src/io/scribe.cpp
src/policy/tcp.cpp
src/policy/udp.cpp
TEST_SOURCES
test/io-test.cpp
TEST_SUITES
detail.prometheus_broker
io.basp.message_queue
io.basp_broker
io.broker
io.http_broker
io.monitor
io.network.default_multiplexer
io.network.ip_endpoint
io.receive_buffer
io.remote_actor
io.remote_group
io.remote_spawn
io.unpublish
io.worker
)
if
(
CAF_ENABLE_TESTING AND UNIX
)
caf_add_test_suites
(
caf-io-test io.middleman
)
endif
()
libcaf_openssl/CMakeLists.txt
View file @
99c43535
# --
get header files for creating "proper" XCode projects
---------------------
# --
collect header files ---------------------------------
---------------------
file
(
GLOB_RECURSE CAF_OPENSSL_HEADERS
"caf/*.hpp"
)
...
...
@@ -8,55 +8,27 @@ if(NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto)
find_package
(
OpenSSL REQUIRED
)
endif
()
# -- utility function for setting default properties ---------------------------
function
(
caf_openssl_set_default_properties
)
foreach
(
target
${
ARGN
}
)
# Set global defaults and set EXPORTS flag.
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_openssl_EXPORTS
)
# Pull in public dependencies.
caf_target_link_libraries
(
${
target
}
PUBLIC
CAF::core CAF::io OpenSSL::SSL OpenSSL::Crypto
)
endforeach
()
endfunction
()
# -- add library target --------------------------------------------------------
add_library
(
libcaf_openssl_obj OBJECT
${
CAF_OPENSSL_HEADERS
}
src/openssl/manager.cpp
src/openssl/middleman_actor.cpp
src/openssl/publish.cpp
src/openssl/remote_actor.cpp
src/openssl/session.cpp
)
add_library
(
libcaf_openssl
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
caf_openssl_set_default_properties
(
libcaf_openssl_obj libcaf_openssl
)
caf_export_and_install_lib
(
openssl
)
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_ENABLE_TESTING
)
return
()
endif
()
add_executable
(
caf-openssl-test
test/openssl-test.cpp
${
CAF_OPENSSL_TEST_SOURCES
}
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
caf_openssl_set_default_properties
(
caf-openssl-test
)
target_include_directories
(
caf-openssl-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_link_libraries
(
caf-openssl-test PRIVATE CAF::test
)
caf_add_test_suites
(
caf-openssl-test
openssl.authentication
openssl.remote_actor
)
# -- add targets ---------------------------------------------------------------
caf_add_component
(
openssl
DEPENDENCIES
PUBLIC
CAF::io
OpenSSL::SSL
OpenSSL::Crypto
PRIVATE
CAF::internal
HEADERS
${
CAF_OPENSSL_HEADERS
}
SOURCES
src/openssl/manager.cpp
src/openssl/middleman_actor.cpp
src/openssl/publish.cpp
src/openssl/remote_actor.cpp
src/openssl/session.cpp
TEST_SOURCES
test/openssl-test.cpp
TEST_SUITES
openssl.authentication
openssl.remote_actor
)
tools/CMakeLists.txt
View file @
99c43535
...
...
@@ -7,13 +7,13 @@ macro(add name)
endmacro
()
add
(
caf-vec
)
target_link_libraries
(
caf-vec PRIVATE CAF::core
)
target_link_libraries
(
caf-vec PRIVATE CAF::
internal CAF::
core
)
if
(
TARGET CAF::io
)
if
(
WIN32
)
message
(
STATUS
"
s
kip caf-run (not supported on Windows)"
)
message
(
STATUS
"
S
kip caf-run (not supported on Windows)"
)
else
()
add
(
caf-run
)
target_link_libraries
(
caf-run PRIVATE CAF::i
o CAF::core
)
target_link_libraries
(
caf-run PRIVATE CAF::i
nternal CAF::io
)
endif
()
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment