Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
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
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-incubator
Commits
6188521e
Commit
6188521e
authored
Apr 16, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid helper target
parent
619bbc6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
libcaf_net/CMakeLists.txt
libcaf_net/CMakeLists.txt
+21
-24
No files found.
libcaf_net/CMakeLists.txt
View file @
6188521e
...
@@ -13,21 +13,23 @@ caf_incubator_add_enum_consistency_check("caf/net/basp/message_type.hpp"
...
@@ -13,21 +13,23 @@ caf_incubator_add_enum_consistency_check("caf/net/basp/message_type.hpp"
caf_incubator_add_enum_consistency_check
(
"caf/net/operation.hpp"
caf_incubator_add_enum_consistency_check
(
"caf/net/operation.hpp"
"src/basp/operation_strings.cpp"
)
"src/basp/operation_strings.cpp"
)
# -- collect shared flags in a helper target -----------------------------------
# -- utility function for setting default properties ---------------------------
add_library
(
libcaf_net_helper INTERFACE
)
function
(
caf_net_set_default_properties
)
foreach
(
target
${
ARGN
}
)
target_include_directories
(
libcaf_net_helper INTERFACE
# Make sure we find our headers plus the the generated export header.
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
target_include_directories
(
${
target
}
PRIVATE
"
${
CMAKE_BINARY_DIR
}
"
)
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"
${
CMAKE_BINARY_DIR
}
"
)
if
(
BUILD_SHARED_LIBS AND NOT WIN32
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_net_EXPORTS
)
target_compile_options
(
libcaf_net_helper INTERFACE -fPIC
)
# Force -fPIC on UNIX systems.
endif
()
if
(
BUILD_SHARED_LIBS AND UNIX
)
target_compile_options
(
${
target
}
PRIVATE -fPIC
)
target_link_libraries
(
libcaf_net_helper INTERFACE CAF::core
)
endif
()
# Pull in public dependencies.
target_compile_definitions
(
libcaf_net_helper INTERFACE libcaf_net_EXPORTS
)
target_link_libraries
(
${
target
}
PUBLIC CAF::core
)
endforeach
()
endfunction
()
# -- add library targets -------------------------------------------------------
# -- add library targets -------------------------------------------------------
...
@@ -72,11 +74,7 @@ generate_export_header(libcaf_net
...
@@ -72,11 +74,7 @@ generate_export_header(libcaf_net
EXPORT_MACRO_NAME CAF_NET_EXPORT
EXPORT_MACRO_NAME CAF_NET_EXPORT
EXPORT_FILE_NAME
"
${
CMAKE_BINARY_DIR
}
/caf/detail/net_export.hpp"
)
EXPORT_FILE_NAME
"
${
CMAKE_BINARY_DIR
}
/caf/detail/net_export.hpp"
)
target_link_libraries
(
libcaf_net_obj PRIVATE libcaf_net_helper
)
caf_net_set_default_properties
(
libcaf_net_obj libcaf_net
)
target_link_libraries
(
libcaf_net PRIVATE libcaf_net_helper
)
target_link_libraries
(
libcaf_net INTERFACE CAF::core
)
target_include_directories
(
libcaf_net INTERFACE
target_include_directories
(
libcaf_net INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
)
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
)
...
@@ -115,12 +113,11 @@ add_executable(caf-net-test
...
@@ -115,12 +113,11 @@ add_executable(caf-net-test
test/net-test.cpp
test/net-test.cpp
$<TARGET_OBJECTS:libcaf_net_obj>
)
$<TARGET_OBJECTS:libcaf_net_obj>
)
target_include_directories
(
caf-net-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
caf_net_set_default_properties
(
caf-net-test
)
target_
compile_definitions
(
caf-net-test PRIVATE libcaf_net_EXPORTS
)
target_
include_directories
(
caf-net-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_link_libraries
(
caf-net-test PRIVATE
target_link_libraries
(
caf-net-test PRIVATE CAF::test
)
libcaf_net_helper CAF::core CAF::test
)
caf_incubator_add_test_suites
(
caf-net-test
caf_incubator_add_test_suites
(
caf-net-test
net.basp.message_queue
net.basp.message_queue
...
...
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