Skip to content

Commit d65b003

Browse files
Expose mock headers (#66)
Signed-off-by: Alexey-N-Chernyshov <[email protected]>
1 parent bf2aae9 commit d65b003

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ option(LSAN "Enable leak sanitizer" OFF)
4040
option(MSAN "Enable memory sanitizer" OFF)
4141
option(TSAN "Enable thread sanitizer" OFF)
4242
option(UBSAN "Enable UB sanitizer" OFF)
43+
option(EXPOSE_MOCKS "Make mocks header files visible for child projects" OFF)
4344

4445

4546
## setup compilation flags

cmake/install.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include(GNUInstallDirs)
22

3-
function (libp2p_install targets)
3+
function(libp2p_install targets)
44
install(TARGETS ${targets} EXPORT libp2pConfig
55
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
66
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -20,3 +20,9 @@ install(
2020
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libp2p
2121
NAMESPACE p2p::
2222
)
23+
if(EXPOSE_MOCKS)
24+
install(
25+
DIRECTORY ${CMAKE_SOURCE_DIR}/test/mock/libp2p
26+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mock
27+
)
28+
endif()

0 commit comments

Comments
 (0)