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
6bbe993f
Commit
6bbe993f
authored
Apr 16, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linking of object libs and examples
parent
7e99d5c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
15 deletions
+36
-15
CMakeLists.txt
CMakeLists.txt
+30
-3
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+2
-4
libcaf_io/CMakeLists.txt
libcaf_io/CMakeLists.txt
+2
-4
libcaf_openssl/CMakeLists.txt
libcaf_openssl/CMakeLists.txt
+2
-4
No files found.
CMakeLists.txt
View file @
6bbe993f
...
...
@@ -72,6 +72,27 @@ endif()
# -- compiler setup ------------------------------------------------------------
# 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
}
)
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
()
endif
()
endfunction
()
function
(
caf_set_default_properties
)
foreach
(
target
${
ARGN
}
)
if
(
MSVC
)
...
...
@@ -95,10 +116,15 @@ function(caf_set_default_properties)
target_compile_options
(
${
target
}
PRIVATE
-fsanitize=
${
CAF_SANITIZERS
}
-fno-omit-frame-pointer
)
target_link_libraries
(
${
target
}
PRIVATE
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
}
"
...
...
@@ -269,6 +295,7 @@ function(caf_export_and_install_lib component)
string
(
TOUPPER
"CAF_
${
component
}
_EXPORT"
exportMacroName
)
target_include_directories
(
libcaf_
${
component
}
INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
)
generate_export_header
(
libcaf_
${
component
}
...
...
libcaf_core/CMakeLists.txt
View file @
6bbe993f
...
...
@@ -33,9 +33,9 @@ function(caf_core_set_default_properties)
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_core_EXPORTS
)
# Pull in public dependencies.
target_link_libraries
(
${
target
}
PUBLIC Threads::Threads
)
caf_
target_link_libraries
(
${
target
}
PUBLIC Threads::Threads
)
if
(
MSVC
)
target_link_libraries
(
${
target
}
PUBLIC iphlpapi
)
caf_
target_link_libraries
(
${
target
}
PUBLIC iphlpapi
)
endif
()
endforeach
()
endfunction
()
...
...
@@ -175,8 +175,6 @@ add_library(libcaf_core_obj OBJECT ${CAF_CORE_HEADERS}
src/uuid.cpp
)
set_property
(
TARGET libcaf_core_obj PROPERTY POSITION_INDEPENDENT_CODE ON
)
add_library
(
libcaf_core
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_core_obj>
)
...
...
libcaf_io/CMakeLists.txt
View file @
6bbe993f
...
...
@@ -18,9 +18,9 @@ function(caf_io_set_default_properties)
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_io_EXPORTS
)
# Pull in public dependencies.
target_link_libraries
(
${
target
}
PUBLIC CAF::core
)
caf_
target_link_libraries
(
${
target
}
PUBLIC CAF::core
)
if
(
MSVC
)
target_link_libraries
(
${
target
}
PUBLIC ws2_32 iphlpapi
)
caf_
target_link_libraries
(
${
target
}
PUBLIC ws2_32 iphlpapi
)
endif
()
endforeach
()
endfunction
()
...
...
@@ -70,8 +70,6 @@ add_library(libcaf_io_obj OBJECT ${CAF_IO_HEADERS}
src/policy/udp.cpp
)
set_property
(
TARGET libcaf_io_obj PROPERTY POSITION_INDEPENDENT_CODE ON
)
add_library
(
libcaf_io
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_io_obj>
)
...
...
libcaf_openssl/CMakeLists.txt
View file @
6bbe993f
...
...
@@ -16,7 +16,7 @@ function(caf_openssl_set_default_properties)
caf_set_default_properties
(
${
target
}
)
target_compile_definitions
(
${
target
}
PRIVATE libcaf_openssl_EXPORTS
)
# Pull in public dependencies.
target_link_libraries
(
${
target
}
PUBLIC
caf_
target_link_libraries
(
${
target
}
PUBLIC
CAF::core CAF::io OpenSSL::SSL OpenSSL::Crypto
)
endforeach
()
endfunction
()
...
...
@@ -31,8 +31,6 @@ add_library(libcaf_openssl_obj OBJECT ${CAF_OPENSSL_HEADERS}
src/openssl/session.cpp
)
set_property
(
TARGET libcaf_openssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON
)
add_library
(
libcaf_openssl
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
...
...
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