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
)
project
(
CAF CXX
)
cmake_policy
(
PUSH
)
cmake_policy
(
VERSION 3.5...3.18
)
# -- includes ------------------------------------------------------------------
# -- includes ------------------------------------------------------------------
include
(
CMakeDependentOption
)
# Conditional default values
include
(
CMakeDependentOption
)
include
(
CMakePackageConfigHelpers
)
# For creating .cmake files
include
(
CMakePackageConfigHelpers
)
include
(
CheckCXXSourceCompiles
)
# For checking whether some C++ features work
include
(
CheckCXXSourceCompiles
)
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GNUInstallDirs
)
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
include
(
GenerateExportHeader
)
# -- override CMake defaults for internal cache entries ------------------------
# -- override CMake defaults for internal cache entries ------------------------
...
@@ -77,67 +80,26 @@ if(MSVC AND CAF_SANITIZERS)
...
@@ -77,67 +80,26 @@ if(MSVC AND CAF_SANITIZERS)
message
(
FATAL_ERROR
"Sanitizer builds are currently not supported on MSVC"
)
message
(
FATAL_ERROR
"Sanitizer builds are currently not supported on MSVC"
)
endif
()
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.
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
function
(
caf_target_link_libraries target access
)
target_compile_options
(
caf_internal INTERFACE -Wall -Wextra -pedantic
get_target_property
(
targetType
${
target
}
TYPE
)
-ftemplate-depth=512 -ftemplate-backtrace-limit=0
)
if
(
NOT targetType STREQUAL OBJECT_LIBRARY
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
target_
link_libraries
(
${
target
}
${
access
}
${
ARGN
}
)
target_
compile_options
(
caf_internal INTERFACE -Wdocumentation
)
else
()
else
()
# If we can't link against it, at least make sure to pull in INTERFACE
target_compile_options
(
caf_internal INTERFACE
# includes and compiler options.
-Wno-missing-field-initializers
)
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
()
endif
()
endif
()
endfunction
()
endif
()
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
()
# -- unit testing setup / caf_add_test_suites function ------------------------
# -- unit testing setup / caf_add_test_suites function ------------------------
...
@@ -183,59 +145,17 @@ if(NOT CMAKE_CROSSCOMPILING)
...
@@ -183,59 +145,17 @@ if(NOT CMAKE_CROSSCOMPILING)
\n
Please see README.md for supported compilers.\
\n
Please see README.md for supported compilers.\
\n\n
try_compile output:
\n
${
cxx_check_output
}
"
)
\n\n
try_compile output:
\n
${
cxx_check_output
}
"
)
endif
()
endif
()
add_compile_options
(
"
${
cxx_flag
}
"
)
target_compile_options
(
caf_internal INTERFACE
"
${
cxx_flag
}
"
)
endif
()
endif
()
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_target_properties
(
caf_internal PROPERTIES EXPORT_NAME internal
)
set
(
CMAKE_CXX_VISIBILITY_PRESET hidden
)
set
(
CMAKE_VISIBILITY_INLINES_HIDDEN yes
)
cmake_policy
(
SET CMP0063 NEW
)
endif
()
# -- utility targets -----------------------------------------------------------
add_library
(
CAF::internal ALIAS caf_internal
)
if
(
CAF_ENABLE_UTILITY_TARGETS
)
install
(
TARGETS caf_internal EXPORT CAFTargets
)
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
()
# -- get CAF version -----------------------------------------------------------
# -- get CAF version -----------------------------------------------------------
...
@@ -259,12 +179,6 @@ else()
...
@@ -259,12 +179,6 @@ else()
CACHE INTERNAL
"The version string used for shared library objects"
)
CACHE INTERNAL
"The version string used for shared library objects"
)
endif
()
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 -----------------------------------------------
# -- install testing DSL headers -----------------------------------------------
add_library
(
libcaf_test INTERFACE
)
add_library
(
libcaf_test INTERFACE
)
...
@@ -296,27 +210,67 @@ if(NOT TARGET uninstall)
...
@@ -296,27 +210,67 @@ if(NOT TARGET uninstall)
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_CURRENT_BINARY_DIR
}
/uninstall.cmake
)
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_CURRENT_BINARY_DIR
}
/uninstall.cmake
)
endif
()
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
)
function
(
caf_export_and_install_lib component
)
add_library
(
CAF::
${
component
}
ALIAS libcaf_
${
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
target_include_directories
(
libcaf_
${
component
}
INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_
CURRENT_
BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
)
$<INSTALL_INTERFACE:include>
)
generate_export_header
(
generate_export_header
(
libcaf_
${
component
}
libcaf_
${
component
}
EXPORT_MACRO_NAME
${
export
MacroN
ame
}
EXPORT_MACRO_NAME
${
export
_macro_n
ame
}
EXPORT_FILE_NAME
"
${
CMAKE_BINARY_DIR
}
/
caf/detail/
${
component
}
_export.hpp"
)
EXPORT_FILE_NAME
"caf/detail/
${
component
}
_export.hpp"
)
set_target_properties
(
libcaf_
${
component
}
PROPERTIES
set_target_properties
(
libcaf_
${
component
}
PROPERTIES
EXPORT_NAME
${
component
}
EXPORT_NAME
${
component
}
SOVERSION
${
CAF_VERSION
}
SOVERSION
${
CAF_VERSION
}
VERSION
${
CAF_LIB_VERSION
}
VERSION
${
CAF_LIB_VERSION
}
OUTPUT_NAME caf_
${
component
}
)
OUTPUT_NAME caf_
${
component
}
)
install
(
FILES
"
${
CMAKE_BINARY_DIR
}
/caf/detail/
${
component
}
_export.hpp"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail"
)
install
(
TARGETS libcaf_
${
component
}
install
(
TARGETS libcaf_
${
component
}
EXPORT CAFTargets
EXPORT CAFTargets
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
component
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
component
}
...
@@ -326,6 +280,125 @@ function(caf_export_and_install_lib component)
...
@@ -326,6 +280,125 @@ function(caf_export_and_install_lib component)
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
COMPONENT
${
component
}
COMPONENT
${
component
}
FILES_MATCHING PATTERN
"*.hpp"
)
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
()
endfunction
()
# -- build all components the user asked for -----------------------------------
# -- build all components the user asked for -----------------------------------
...
@@ -348,6 +421,32 @@ if(CAF_ENABLE_TOOLS)
...
@@ -348,6 +421,32 @@ if(CAF_ENABLE_TOOLS)
add_subdirectory
(
tools
)
add_subdirectory
(
tools
)
endif
()
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 -----------------------------------------
# -- generate and install .cmake files -----------------------------------------
export
(
EXPORT CAFTargets FILE CAFTargets.cmake NAMESPACE CAF::
)
export
(
EXPORT CAFTargets FILE CAFTargets.cmake NAMESPACE CAF::
)
...
@@ -373,6 +472,7 @@ install(
...
@@ -373,6 +472,7 @@ install(
DESTINATION
DESTINATION
"
${
CAF_INSTALL_CMAKEDIR
}
"
)
"
${
CAF_INSTALL_CMAKEDIR
}
"
)
# -- extra file output (primarily for CAF CI) ----------------------------------
# -- extra file output (primarily for CAF CI) ----------------------------------
if
(
CAF_BUILD_INFO_FILE_PATH
)
if
(
CAF_BUILD_INFO_FILE_PATH
)
...
@@ -380,3 +480,5 @@ if(CAF_BUILD_INFO_FILE_PATH)
...
@@ -380,3 +480,5 @@ if(CAF_BUILD_INFO_FILE_PATH)
"
${
CAF_BUILD_INFO_FILE_PATH
}
"
"
${
CAF_BUILD_INFO_FILE_PATH
}
"
@ONLY
)
@ONLY
)
endif
()
endif
()
cmake_policy
(
POP
)
cmake/build_config.hpp.in
View file @
99c43535
/******************************************************************************
// this header is auto-generated by CMake
* ____ _ _____ *
* / ___| / \ | ___| 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. *
******************************************************************************/
#pragma once
#pragma once
#include "caf/detail/log_level.hpp"
#include "caf/detail/log_level.hpp"
// this header is auto-generated by CMake
#define CAF_LOG_LEVEL CAF_LOG_LEVEL_@CAF_LOG_LEVEL@
#define CAF_LOG_LEVEL CAF_LOG_LEVEL_@CAF_LOG_LEVEL@
#cmakedefine CAF_ENABLE_RUNTIME_CHECKS
#cmakedefine CAF_ENABLE_RUNTIME_CHECKS
...
...
examples/CMakeLists.txt
View file @
99c43535
...
@@ -2,13 +2,14 @@ add_custom_target(all_examples)
...
@@ -2,13 +2,14 @@ add_custom_target(all_examples)
function
(
add_example folder name
)
function
(
add_example folder name
)
add_executable
(
${
name
}
${
folder
}
/
${
name
}
.cpp
${
ARGN
}
)
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
)
add_dependencies
(
${
name
}
all_examples
)
endfunction
()
endfunction
()
function
(
add_core_example folder name
)
function
(
add_core_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::core
)
target_link_libraries
(
${
name
}
PRIVATE CAF::internal
CAF::core
)
endfunction
()
endfunction
()
# -- examples for CAF::core ----------------------------------------------------
# -- examples for CAF::core ----------------------------------------------------
...
@@ -43,7 +44,7 @@ add_core_example(custom_type custom_types_3)
...
@@ -43,7 +44,7 @@ add_core_example(custom_type custom_types_3)
# testing DSL
# testing DSL
add_example
(
testing ping_pong
)
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 ------------------------------------------------------
# -- examples for CAF::io ------------------------------------------------------
...
@@ -52,7 +53,7 @@ if(TARGET CAF::io)
...
@@ -52,7 +53,7 @@ if(TARGET CAF::io)
function
(
add_io_example folder name
)
function
(
add_io_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::io CAF::core
)
target_link_libraries
(
${
name
}
PRIVATE CAF::internal CAF::io
)
endfunction
()
endfunction
()
# basic remoting
# basic remoting
...
@@ -65,53 +66,52 @@ if(TARGET CAF::io)
...
@@ -65,53 +66,52 @@ if(TARGET CAF::io)
add_io_example
(
broker simple_broker
)
add_io_example
(
broker simple_broker
)
add_io_example
(
broker simple_http_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
)
if
(
CAF_ENABLE_QT5_EXAMPLES
)
find_package
(
Protobuf REQUIRED
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets REQUIRED
)
if
(
NOT PROTOBUF_PROTOC_EXECUTABLE
)
message
(
STATUS
"Found Qt5"
)
message
(
FATAL_ERROR
"CMake was unable to set PROTOBUF_PROTOC_EXECUTABLE"
)
#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
()
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
)
if
(
CAF_ENABLE_CURL_EXAMPLES
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets REQUIRED
)
find_package
(
CURL REQUIRED
)
message
(
STATUS
"Found Qt5"
)
add_executable
(
curl_fuse curl/curl_fuse.cpp
)
#include(${QT_USE_FILE})
include_directories
(
${
CURL_INCLUDE_DIRS
}
)
QT5_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
target_link_libraries
(
curl_fuse
${
CURL_LIBRARY
}
CAF::io
)
QT5_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
add_dependencies
(
curl_fuse all_examples
)
QT5_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
endif
()
# 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::core CAF::io
)
add_dependencies
(
curl_fuse all_examples
)
endif
()
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"
)
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 --------------------------------------------------------------
# -- dependencies --------------------------------------------------------------
if
(
NOT TARGET Threads::Threads
)
if
(
NOT TARGET Threads::Threads
)
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
endif
()
endif
()
# -- utility function for setting default properties ---------------------------
set
(
LIBCAF_CORE_OPTIONAL_DEPENDENCIES
""
)
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"
)
# Check whether we need to link against libatomic.
# Check whether we need to link against libatomic.
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
NOT CMAKE_CROSSCOMPILING
)
...
@@ -213,157 +25,320 @@ if(NOT CMAKE_CROSSCOMPILING)
...
@@ -213,157 +25,320 @@ if(NOT CMAKE_CROSSCOMPILING)
if
(
NOT has_64bit_atomic_with_libatomic
)
if
(
NOT has_64bit_atomic_with_libatomic
)
message
(
FATAL_ERROR
"Unable to compile code with std::atomic<uint64_t>"
)
message
(
FATAL_ERROR
"Unable to compile code with std::atomic<uint64_t>"
)
endif
()
endif
()
target_link_libraries
(
libcaf_core INTERFACE
atomic
)
list
(
APPEND LIBCAF_CORE_OPTIONAL_DEPENDENCIES
atomic
)
endif
()
endif
()
endif
()
endif
()
# -- build unit tests ----------------------------------------------------------
if
(
MSVC
)
list
(
APPEND LIBCAF_CORE_OPTIONAL_DEPENDENCIES iphlpapi
)
if
(
NOT CAF_ENABLE_TESTING
)
return
()
endif
()
endif
()
add_executable
(
caf-core-test
# -- generated files -----------------------------------------------------------
test/core-test.cpp
test/nasty.cpp
$<TARGET_OBJECTS:libcaf_core_obj>
)
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
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/caf/detail/build_config.hpp"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
"
)
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/caf/detail/
"
)
target_link_libraries
(
caf-core-test PUBLIC CAF::test
)
# -- add targets ---------------------------------------------------------------
caf_add_test_suites
(
caf-core-test
caf_add_component
(
actor_clock
core
actor_factory
DEPENDENCIES
actor_lifetime
PUBLIC
actor_pool
Threads::Threads
actor_profiler
${
LIBCAF_CORE_OPTIONAL_DEPENDENCIES
}
actor_registry
PRIVATE
actor_system_config
CAF::internal
actor_termination
ENUM_CONSISTENCY_CHECKS
aout
exit_reason
behavior
intrusive.inbox_result
binary_deserializer
intrusive.task_result
binary_serializer
invoke_message_result
blocking_actor
message_priority
broadcast_downstream_manager
pec
byte
sec
composition
stream_priority
config_option
HEADERS
config_option_set
${
CAF_CORE_HEADERS
}
config_value
SOURCES
config_value_reader
src/abstract_actor.cpp
config_value_writer
src/abstract_channel.cpp
const_typed_message_view
src/abstract_group.cpp
constructor_attach
src/actor.cpp
continuous_streaming
src/actor_addr.cpp
cow_tuple
src/actor_clock.cpp
decorator.sequencer
src/actor_companion.cpp
deep_to_string
src/actor_config.cpp
detached_actors
src/actor_control_block.cpp
detail.bounds_checker
src/actor_ostream.cpp
detail.config_consumer
src/actor_pool.cpp
detail.encode_base64
src/actor_profiler.cpp
detail.group_tunnel
src/actor_proxy.cpp
detail.ieee_754
src/actor_registry.cpp
detail.limited_vector
src/actor_system.cpp
detail.local_group_module
src/actor_system_config.cpp
detail.meta_object
src/attachable.cpp
detail.parse
src/behavior.cpp
detail.parser.read_bool
src/binary_deserializer.cpp
detail.parser.read_config
src/binary_serializer.cpp
detail.parser.read_floating_point
src/blocking_actor.cpp
detail.parser.read_number
src/config_option.cpp
detail.parser.read_number_or_timespan
src/config_option_adder.cpp
detail.parser.read_signed_integer
src/config_option_set.cpp
detail.parser.read_string
src/config_value.cpp
detail.parser.read_timespan
src/config_value_reader.cpp
detail.parser.read_unsigned_integer
src/config_value_writer.cpp
detail.ringbuffer
src/credit_controller.cpp
detail.ripemd_160
src/decorator/sequencer.cpp
detail.serialized_size
src/default_attachable.cpp
detail.tick_emitter
src/deserializer.cpp
detail.type_id_list_builder
src/detail/abstract_worker.cpp
detail.unique_function
src/detail/abstract_worker_hub.cpp
detail.unordered_flat_map
src/detail/append_percent_encoded.cpp
dictionary
src/detail/behavior_impl.cpp
dynamic_spawn
src/detail/behavior_stack.cpp
error
src/detail/blocking_behavior.cpp
expected
src/detail/config_consumer.cpp
function_view
src/detail/encode_base64.cpp
fused_downstream_manager
src/detail/get_mac_addresses.cpp
handles
src/detail/get_process_id.cpp
hash.fnv
src/detail/get_root_uuid.cpp
hash.sha1
src/detail/glob_match.cpp
intrusive.drr_cached_queue
src/detail/group_tunnel.cpp
intrusive.drr_queue
src/detail/invoke_result_visitor.cpp
intrusive.fifo_inbox
src/detail/local_group_module.cpp
intrusive.lifo_inbox
src/detail/message_builder_element.cpp
intrusive.task_queue
src/detail/message_data.cpp
intrusive.wdrr_dynamic_multiplexed_queue
src/detail/meta_object.cpp
intrusive.wdrr_fixed_multiplexed_queue
src/detail/parse.cpp
intrusive_ptr
src/detail/parser/chars.cpp
ipv4_address
src/detail/pretty_type_name.cpp
ipv4_endpoint
src/detail/print.cpp
ipv4_subnet
src/detail/private_thread.cpp
ipv6_address
src/detail/ripemd_160.cpp
ipv6_endpoint
src/detail/serialized_size.cpp
ipv6_subnet
src/detail/set_thread_name.cpp
load_inspector
src/detail/shared_spinlock.cpp
logger
src/detail/simple_actor_clock.cpp
mailbox_element
src/detail/size_based_credit_controller.cpp
message
src/detail/stringification_inspector.cpp
message_builder
src/detail/sync_request_bouncer.cpp
message_id
src/detail/test_actor_clock.cpp
message_lifetime
src/detail/thread_safe_actor_clock.cpp
metaprogramming
src/detail/tick_emitter.cpp
mixin.requester
src/detail/token_based_credit_controller.cpp
mixin.sender
src/detail/type_id_list_builder.cpp
mock_streaming_classes
src/downstream_manager.cpp
native_streaming_classes
src/downstream_manager_base.cpp
node_id
src/error.cpp
optional
src/event_based_actor.cpp
or_else
src/execution_unit.cpp
pipeline_streaming
src/exit_reason_strings.cpp
policy.categorized
src/forwarding_actor_proxy.cpp
policy.select_all
src/group.cpp
policy.select_any
src/group_manager.cpp
request_timeout
src/group_module.cpp
result
src/hash/sha1.cpp
save_inspector
src/inbound_path.cpp
selective_streaming
src/init_global_meta_objects.cpp
serial_reply
src/intrusive/inbox_result_strings.cpp
serialization
src/intrusive/task_result_strings.cpp
settings
src/invoke_message_result_strings.cpp
simple_timeout
src/ipv4_address.cpp
span
src/ipv4_endpoint.cpp
stateful_actor
src/ipv4_subnet.cpp
string_algorithms
src/ipv6_address.cpp
string_view
src/ipv6_endpoint.cpp
sum_type
src/ipv6_subnet.cpp
telemetry.collector.prometheus
src/load_inspector.cpp
telemetry.counter
src/local_actor.cpp
telemetry.gauge
src/logger.cpp
telemetry.histogram
src/mailbox_element.cpp
telemetry.label
src/make_config_option.cpp
telemetry.metric_registry
src/memory_managed.cpp
telemetry.timer
src/message.cpp
thread_hook
src/message_builder.cpp
tracing_data
src/message_handler.cpp
type_id_list
src/message_priority_strings.cpp
typed_behavior
src/monitorable_actor.cpp
typed_message_view
src/node_id.cpp
typed_response_promise
src/outbound_path.cpp
typed_spawn
src/pec_strings.cpp
unit
src/policy/downstream_messages.cpp
uri
src/policy/unprofiled.cpp
uuid
src/policy/work_sharing.cpp
variant
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
)
caf_add_test_suites
(
caf-core-test custom_exception_handler
)
endif
()
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"
)
file
(
GLOB_RECURSE CAF_IO_HEADERS
"caf/*.hpp"
)
# -- add consistency checks for enum to_string implementations -----------------
# -- add targets ---------------------------------------------------------------
caf_add_enum_consistency_check
(
"caf/io/basp/message_type.hpp"
caf_add_component
(
"src/io/basp/message_type_strings.cpp"
)
io
DEPENDENCIES
caf_add_enum_consistency_check
(
"caf/io/network/operation.hpp"
PUBLIC
"src/io/network/operation_strings.cpp"
)
CAF::core
$<$<CXX_COMPILER_ID:MSVC>:ws2_32>
# -- utility function for setting default properties ---------------------------
PRIVATE
CAF::internal
function
(
caf_io_set_default_properties
)
ENUM_CONSISTENCY_CHECKS
foreach
(
target
${
ARGN
}
)
io.basp.message_type
# Set global defaults and set EXPORTS flag.
io.network.operation
caf_set_default_properties
(
${
target
}
)
HEADERS
target_compile_definitions
(
${
target
}
PRIVATE libcaf_io_EXPORTS
)
${
CAF_IO_HEADERS
}
# Pull in public dependencies.
SOURCES
caf_target_link_libraries
(
${
target
}
PUBLIC CAF::core
)
src/detail/prometheus_broker.cpp
if
(
MSVC
)
src/detail/remote_group_module.cpp
caf_target_link_libraries
(
${
target
}
PUBLIC ws2_32 iphlpapi
)
src/detail/socket_guard.cpp
endif
()
src/io/abstract_broker.cpp
endforeach
()
src/io/basp/header.cpp
endfunction
()
src/io/basp/instance.cpp
src/io/basp/message_queue.cpp
# -- add library target --------------------------------------------------------
src/io/basp/message_type_strings.cpp
src/io/basp/routing_table.cpp
add_library
(
libcaf_io_obj OBJECT
${
CAF_IO_HEADERS
}
src/io/basp/worker.cpp
src/detail/prometheus_broker.cpp
src/io/basp_broker.cpp
src/detail/remote_group_module.cpp
src/io/broker.cpp
src/detail/socket_guard.cpp
src/io/connection_helper.cpp
src/io/abstract_broker.cpp
src/io/datagram_servant.cpp
src/io/basp/header.cpp
src/io/doorman.cpp
src/io/basp/instance.cpp
src/io/middleman.cpp
src/io/basp/message_queue.cpp
src/io/middleman_actor.cpp
src/io/basp/message_type_strings.cpp
src/io/middleman_actor_impl.cpp
src/io/basp/routing_table.cpp
src/io/network/acceptor.cpp
src/io/basp/worker.cpp
src/io/network/acceptor_manager.cpp
src/io/basp_broker.cpp
src/io/network/datagram_handler.cpp
src/io/broker.cpp
src/io/network/datagram_manager.cpp
src/io/connection_helper.cpp
src/io/network/datagram_servant_impl.cpp
src/io/datagram_servant.cpp
src/io/network/default_multiplexer.cpp
src/io/doorman.cpp
src/io/network/doorman_impl.cpp
src/io/middleman.cpp
src/io/network/event_handler.cpp
src/io/middleman_actor.cpp
src/io/network/interfaces.cpp
src/io/middleman_actor_impl.cpp
src/io/network/ip_endpoint.cpp
src/io/network/acceptor.cpp
src/io/network/manager.cpp
src/io/network/acceptor_manager.cpp
src/io/network/multiplexer.cpp
src/io/network/datagram_handler.cpp
src/io/network/native_socket.cpp
src/io/network/datagram_manager.cpp
src/io/network/operation_strings.cpp
src/io/network/datagram_servant_impl.cpp
src/io/network/pipe_reader.cpp
src/io/network/default_multiplexer.cpp
src/io/network/protocol.cpp
src/io/network/doorman_impl.cpp
src/io/network/receive_buffer.cpp
src/io/network/event_handler.cpp
src/io/network/scribe_impl.cpp
src/io/network/interfaces.cpp
src/io/network/stream.cpp
src/io/network/ip_endpoint.cpp
src/io/network/stream_manager.cpp
src/io/network/manager.cpp
src/io/network/test_multiplexer.cpp
src/io/network/multiplexer.cpp
src/io/scribe.cpp
src/io/network/native_socket.cpp
src/policy/tcp.cpp
src/io/network/operation_strings.cpp
src/policy/udp.cpp
src/io/network/pipe_reader.cpp
TEST_SOURCES
src/io/network/protocol.cpp
test/io-test.cpp
src/io/network/receive_buffer.cpp
TEST_SUITES
src/io/network/scribe_impl.cpp
detail.prometheus_broker
src/io/network/stream.cpp
io.basp.message_queue
src/io/network/stream_manager.cpp
io.basp_broker
src/io/network/test_multiplexer.cpp
io.broker
src/io/scribe.cpp
io.http_broker
src/policy/tcp.cpp
io.monitor
src/policy/udp.cpp
io.network.default_multiplexer
)
io.network.ip_endpoint
io.receive_buffer
add_library
(
libcaf_io
io.remote_actor
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
io.remote_group
$<TARGET_OBJECTS:libcaf_io_obj>
)
io.remote_spawn
io.unpublish
caf_io_set_default_properties
(
libcaf_io_obj libcaf_io
)
io.worker
)
caf_export_and_install_lib
(
io
)
if
(
CAF_ENABLE_TESTING AND UNIX
)
# -- 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
)
caf_add_test_suites
(
caf-io-test io.middleman
)
caf_add_test_suites
(
caf-io-test io.middleman
)
endif
()
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"
)
file
(
GLOB_RECURSE CAF_OPENSSL_HEADERS
"caf/*.hpp"
)
...
@@ -8,55 +8,27 @@ if(NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto)
...
@@ -8,55 +8,27 @@ if(NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto)
find_package
(
OpenSSL REQUIRED
)
find_package
(
OpenSSL REQUIRED
)
endif
()
endif
()
# -- utility function for setting default properties ---------------------------
# -- add targets ---------------------------------------------------------------
function
(
caf_openssl_set_default_properties
)
caf_add_component
(
foreach
(
target
${
ARGN
}
)
openssl
# Set global defaults and set EXPORTS flag.
DEPENDENCIES
caf_set_default_properties
(
${
target
}
)
PUBLIC
target_compile_definitions
(
${
target
}
PRIVATE libcaf_openssl_EXPORTS
)
CAF::io
# Pull in public dependencies.
OpenSSL::SSL
caf_target_link_libraries
(
${
target
}
PUBLIC
OpenSSL::Crypto
CAF::core CAF::io OpenSSL::SSL OpenSSL::Crypto
)
PRIVATE
endforeach
()
CAF::internal
endfunction
()
HEADERS
${
CAF_OPENSSL_HEADERS
}
# -- add library target --------------------------------------------------------
SOURCES
src/openssl/manager.cpp
add_library
(
libcaf_openssl_obj OBJECT
${
CAF_OPENSSL_HEADERS
}
src/openssl/middleman_actor.cpp
src/openssl/manager.cpp
src/openssl/publish.cpp
src/openssl/middleman_actor.cpp
src/openssl/remote_actor.cpp
src/openssl/publish.cpp
src/openssl/session.cpp
src/openssl/remote_actor.cpp
TEST_SOURCES
src/openssl/session.cpp
test/openssl-test.cpp
)
TEST_SUITES
openssl.authentication
add_library
(
libcaf_openssl
openssl.remote_actor
)
"
${
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
)
tools/CMakeLists.txt
View file @
99c43535
...
@@ -7,13 +7,13 @@ macro(add name)
...
@@ -7,13 +7,13 @@ macro(add name)
endmacro
()
endmacro
()
add
(
caf-vec
)
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
(
TARGET CAF::io
)
if
(
WIN32
)
if
(
WIN32
)
message
(
STATUS
"
s
kip caf-run (not supported on Windows)"
)
message
(
STATUS
"
S
kip caf-run (not supported on Windows)"
)
else
()
else
()
add
(
caf-run
)
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
()
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