Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions crates/c-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ else()
endif()
endif()

target_include_directories(wasmtime INTERFACE ${CMAKE_BINARY_DIR}/include)
set(WASMTIME_HEADER_DST ${CMAKE_BINARY_DIR}/include)
include(cmake/install-headers.cmake)
target_include_directories(wasmtime
INTERFACE include
INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/include)
configure_file(include/wasmtime/conf.h.in include/wasmtime/conf.h)

include(GNUInstallDirs)
install(DIRECTORY "${WASMTIME_HEADER_DST}/" TYPE INCLUDE)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ TYPE INCLUDE)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ TYPE INCLUDE
FILES_MATCHING REGEX "\\.hh?$")
install(FILES ${WASMTIME_SHARED_FILES} ${WASMTIME_STATIC_FILES}
DESTINATION ${CMAKE_INSTALL_LIBDIR})

Expand All @@ -130,15 +133,6 @@ add_custom_target(doc
COMMAND doxygen ${DOXYGEN_CONF_OUT}
DEPENDS ${WASMTIME_GENERATED_CONF_H} ${DOXYGEN_CONF_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_dependencies(doc headers-to-doc)

file(GLOB headers "include/*.h")
add_custom_target(headers-to-doc
COMMAND
${CMAKE_COMMAND}
-DWASMTIME_HEADER_DST=${CMAKE_BINARY_DIR}/include
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install-headers.cmake
DEPENDS ${headers})

if (NOT CMAKE_CXX_STANDARD)
message(STATUS "Cannot detect C++ Standard. Switching to C++17 by default !!")
Expand Down Expand Up @@ -168,11 +162,6 @@ else()
target_link_libraries(wasmtime-cpp INTERFACE stdc++ pthread)
endif()

target_include_directories(
wasmtime-cpp
INTERFACE
${PROJECT_SOURCE_DIR}/include)

if (BUILD_TESTS)
message(STATUS "Building tests")
set(CMAKE_CXX_STANDARD 20)
Expand Down
2 changes: 1 addition & 1 deletion crates/c-api/doxygen.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_BINARY_DIR@/include
INPUT = @CMAKE_SOURCE_DIR@/include @CMAKE_BINARY_DIR@/include

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down