Skip to content

Commit 3d83c7a

Browse files
committed
Merge #146: cmake: Suppress compiler warnings from capnproto headers
72326b5 cmake: Simplify capnp include handling (Ryan Ofsky) 65c7048 cmake: Suppress compiler warnings from capnproto headers (Ryan Ofsky) Pull request description: Tweak `target_link_libraries` calls to correctly declare dependencies on capnproto libraries as public, so capnproto include directories get correctly added to downstream targets. Without this, compiler warnings can be triggered from capnproto headers because they are not treated like external headers. Fixes #138 This should be an alternative to #141 Top commit has no ACKs. Tree-SHA512: fc8349335db98bd578e59bd8206da6f440aa6be3468cbb08099e94a336dca4c6534a653b1cf25e79c6aef5481f873c8272df895eeeb57988bb621e5b705c562a
2 parents 2fdd920 + 72326b5 commit 3d83c7a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ capnp_generate_cpp(MP_PROXY_SRCS MP_PROXY_HDRS include/mp/proxy.capnp)
5555
add_library(mputil OBJECT src/mp/util.cpp)
5656
target_include_directories(mputil PRIVATE
5757
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
58-
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
59-
${CAPNP_INCLUDE_DIRECTORY})
58+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
59+
target_link_libraries(mputil PUBLIC CapnProto::kj)
6060

6161
# libmultiprocess.a runtime library
6262
set(MP_PUBLIC_HEADERS
@@ -95,12 +95,11 @@ add_library(Libmultiprocess::multiprocess ALIAS multiprocess)
9595
target_include_directories(multiprocess PUBLIC
9696
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
9797
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
98-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
99-
${CAPNP_INCLUDE_DIRECTORY})
100-
target_link_libraries(multiprocess PRIVATE CapnProto::capnp)
101-
target_link_libraries(multiprocess PRIVATE CapnProto::capnp-rpc)
102-
target_link_libraries(multiprocess PRIVATE CapnProto::kj)
103-
target_link_libraries(multiprocess PRIVATE CapnProto::kj-async)
98+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
99+
target_link_libraries(multiprocess PUBLIC CapnProto::capnp)
100+
target_link_libraries(multiprocess PUBLIC CapnProto::capnp-rpc)
101+
target_link_libraries(multiprocess PUBLIC CapnProto::kj)
102+
target_link_libraries(multiprocess PUBLIC CapnProto::kj-async)
104103
set_target_properties(multiprocess PROPERTIES
105104
PUBLIC_HEADER "${MP_PUBLIC_HEADERS}")
106105
install(TARGETS multiprocess EXPORT LibTargets

0 commit comments

Comments
 (0)