Commit 43e2750b authored by Dominik Charousset's avatar Dominik Charousset

Fix exporting and installing of incubator libs

parent ed849af0
...@@ -2,44 +2,24 @@ ...@@ -2,44 +2,24 @@
file(GLOB_RECURSE CAF_NET_HEADERS "caf/*.hpp") file(GLOB_RECURSE CAF_NET_HEADERS "caf/*.hpp")
# -- add consistency checks for enum to_string implementations ----------------- # -- add targets ---------------------------------------------------------------
caf_incubator_add_enum_consistency_check("caf/net/basp/connection_state.hpp" caf_incubator_add_component(
"src/basp/connection_state_strings.cpp") net
caf_incubator_add_enum_consistency_check("caf/net/basp/ec.hpp" DEPENDENCIES
"src/basp/ec_strings.cpp") PUBLIC
caf_incubator_add_enum_consistency_check("caf/net/basp/message_type.hpp" CAF::core
"src/basp/message_type_strings.cpp") $<$<CXX_COMPILER_ID:MSVC>:ws2_32>
caf_incubator_add_enum_consistency_check("caf/net/operation.hpp" PRIVATE
"src/basp/operation_strings.cpp") CAF::internal
ENUM_CONSISTENCY_CHECKS
# -- utility function for setting default properties --------------------------- net.basp.connection_state
net.basp.ec
function(caf_net_set_default_properties) net.basp.message_type
foreach(target ${ARGN}) net.operation
caf_incubator_set_default_properties(${target}) HEADERS
# Make sure we find our headers plus the the generated export header. ${CAF_NET_HEADERS}
target_include_directories(${target} PRIVATE SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_BINARY_DIR}")
target_compile_definitions(${target} PRIVATE libcaf_net_EXPORTS)
# Pull in public dependencies.
target_link_libraries(${target} PUBLIC CAF::core)
if(MSVC)
target_link_libraries(${target} PUBLIC ws2_32 iphlpapi)
endif()
endforeach()
endfunction()
# -- add library targets -------------------------------------------------------
add_library(libcaf_net_obj OBJECT ${CAF_NET_HEADERS}
#src/actor_proxy_impl.cpp
#src/basp/application.cpp
#src/endpoint_manager.cpp
#src/net/backend/tcp.cpp
#src/net/backend/test.cpp
#src/net/endpoint_manager_queue.cpp
src/basp/connection_state_strings.cpp src/basp/connection_state_strings.cpp
src/basp/ec_strings.cpp src/basp/ec_strings.cpp
src/basp/message_type_strings.cpp src/basp/message_type_strings.cpp
...@@ -68,80 +48,17 @@ add_library(libcaf_net_obj OBJECT ${CAF_NET_HEADERS} ...@@ -68,80 +48,17 @@ add_library(libcaf_net_obj OBJECT ${CAF_NET_HEADERS}
src/tcp_stream_socket.cpp src/tcp_stream_socket.cpp
src/udp_datagram_socket.cpp src/udp_datagram_socket.cpp
src/worker.cpp src/worker.cpp
) TEST_SOURCES
add_library(libcaf_net "${PROJECT_SOURCE_DIR}/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_net_obj>)
generate_export_header(libcaf_net
EXPORT_MACRO_NAME CAF_NET_EXPORT
EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/caf/detail/net_export.hpp")
set_property(TARGET libcaf_net_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
caf_net_set_default_properties(libcaf_net_obj libcaf_net)
target_include_directories(libcaf_net INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>)
add_library(CAF::net ALIAS libcaf_net)
set_target_properties(libcaf_net PROPERTIES
EXPORT_NAME net
SOVERSION ${CAF_VERSION}
VERSION ${CAF_LIB_VERSION}
OUTPUT_NAME caf_net)
# -- install library and header files ------------------------------------------
install(FILES "${CMAKE_BINARY_DIR}/caf/detail/net_export.hpp"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/caf/detail")
install(TARGETS libcaf_net
EXPORT CAFTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT net
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT net
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT net)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/caf"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT net
FILES_MATCHING PATTERN "*.hpp")
# -- build unit tests ----------------------------------------------------------
if(NOT CAF_INC_ENABLE_TESTING)
return()
endif()
add_executable(caf-net-test
test/net-test.cpp test/net-test.cpp
$<TARGET_OBJECTS:libcaf_net_obj>) TEST_SUITES
caf_net_set_default_properties(caf-net-test)
target_include_directories(caf-net-test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/test")
target_link_libraries(caf-net-test PRIVATE CAF::test)
caf_incubator_add_test_suites(caf-net-test
accept_socket accept_socket
#application
convert_ip_endpoint convert_ip_endpoint
datagram_socket datagram_socket
detail.rfc6455 detail.rfc6455
#datagram_transport
#doorman
#endpoint_manager
header header
ip ip
multiplexer multiplexer
net.actor_shell net.actor_shell
#net.backend.tcp
#net.basp.message_queue
#net.basp.ping_pong
#net.basp.worker
net.length_prefix_framing net.length_prefix_framing
net.typed_actor_shell net.typed_actor_shell
net.web_socket_server net.web_socket_server
...@@ -149,12 +66,7 @@ caf_incubator_add_test_suites(caf-net-test ...@@ -149,12 +66,7 @@ caf_incubator_add_test_suites(caf-net-test
pipe_socket pipe_socket
socket socket
socket_guard socket_guard
#stream_application
stream_socket stream_socket
stream_transport stream_transport
#string_application
tcp_sockets tcp_sockets
#transport_worker udp_datagram_socket)
#transport_worker_dispatcher
udp_datagram_socket
)
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "caf/byte.hpp" #include "caf/byte.hpp"
#include "caf/detail/net_export.hpp" #include "caf/detail/net_export.hpp"
#include "caf/fwd.hpp"
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include "caf/intrusive_ptr.hpp" #include "caf/intrusive_ptr.hpp"
#include "caf/type_id.hpp"
namespace caf::net { namespace caf::net {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment