diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7311877997d9..5f0bfa0ca4d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -255,7 +255,8 @@ jobs: # Build C API documentation - run: curl -L https://sourceforge.net/projects/doxygen/files/rel-1.9.3/doxygen-1.9.3.linux.bin.tar.gz/download | tar xzf - - run: echo "`pwd`/doxygen-1.9.3/bin" >> $GITHUB_PATH - - run: cd crates/c-api && doxygen doxygen.conf + - run: cmake -S crates/c-api -B target/c-api + - run: cmake --build target/c-api --target doc # install mdbook, build the docs, and test the docs - uses: actions/cache@v4 diff --git a/crates/c-api/CMakeLists.txt b/crates/c-api/CMakeLists.txt index ad0895c4036a..c529081e63a4 100644 --- a/crates/c-api/CMakeLists.txt +++ b/crates/c-api/CMakeLists.txt @@ -142,8 +142,8 @@ endif() target_include_directories(wasmtime INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) -set(WASMTIME_GENERATED_CONF_H ${CMAKE_BINARY_DIR}/wasmtime-gen/wasmtime/conf.h) -target_include_directories(wasmtime INTERFACE ${CMAKE_BINARY_DIR}/wasmtime-gen) +set(WASMTIME_GENERATED_CONF_H ${CMAKE_BINARY_DIR}/include/wasmtime/conf.h) +target_include_directories(wasmtime INTERFACE ${CMAKE_BINARY_DIR}/include) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/wasmtime/conf.h.in @@ -157,3 +157,10 @@ install(FILES ${WASMTIME_GENERATED_CONF_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wasmtime) install(FILES ${WASMTIME_SHARED_FILES} ${WASMTIME_STATIC_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +set(DOXYGEN_CONF_IN ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf.in) +set(DOXYGEN_CONF_OUT ${CMAKE_BINARY_DIR}/doxygen.conf) +configure_file(${DOXYGEN_CONF_IN} ${DOXYGEN_CONF_OUT}) +add_custom_target(doc doxygen ${DOXYGEN_CONF_OUT} + DEPENDS ${WASMTIME_GENERATED_CONF_H} ${DOXYGEN_CONF_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/crates/c-api/doxygen.conf b/crates/c-api/doxygen.conf.in similarity index 99% rename from crates/c-api/doxygen.conf rename to crates/c-api/doxygen.conf.in index 6c8147e11c27..b2a7c2998b75 100644 --- a/crates/c-api/doxygen.conf +++ b/crates/c-api/doxygen.conf.in @@ -2162,7 +2162,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = include +INCLUDE_PATH = include @CMAKE_BINARY_DIR@/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the