File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,13 @@ set_target_properties(${TARGET} PROPERTIES LINK_OPTIONS "${LINK_OPTIONS}")
5151add_subdirectory (cli)
5252
5353target_link_libraries (silkworm_capi_static_test PRIVATE silkworm_db_test_util)
54+
55+ # collect all public C headers into the same directory
56+ set (HEADERS_INSTALL_PATH "${CMAKE_CURRENT_BINARY_DIR} /include" )
57+ file (GLOB_RECURSE HEADERS "../capi/*.h" "../*/capi/*.h" )
58+ add_custom_command (
59+ TARGET ${TARGET}
60+ POST_BUILD
61+ COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${HEADERS_INSTALL_PATH} "
62+ COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HEADERS} "${HEADERS_INSTALL_PATH} "
63+ )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package main
33// #cgo LDFLAGS: -lsilkworm_capi
44// #cgo LDFLAGS: -L${SRCDIR}/../../../../build/silkworm/capi
55// #cgo LDFLAGS: -Wl,-rpath ${SRCDIR}/../../../../build/silkworm/capi
6- // #cgo CFLAGS: -I${SRCDIR}/../../../../silkworm/capi
6+ // #cgo CFLAGS: -I${SRCDIR}/../../../../build/ silkworm/capi/include
77/*
88#include "silkworm.h"
99#include <stdlib.h>
You can’t perform that action at this time.
0 commit comments