Skip to content

Commit 29eff3d

Browse files
committed
Install all headers to same directory
1 parent adcfe72 commit 29eff3d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

crates/c-api/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ target_include_directories(wasmtime INTERFACE ${CMAKE_BINARY_DIR}/include)
145145
configure_file(
146146
${CMAKE_CURRENT_SOURCE_DIR}/include/wasmtime/conf.h.in
147147
${WASMTIME_GENERATED_CONF_H})
148-
add_custom_target(conf_h
149-
DEPENDS ${WASMTIME_GENERATED_CONF_H})
150148

151149
include(GNUInstallDirs)
152150
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
153151
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
152+
COMPONENT Headers
154153
FILES_MATCHING REGEX "\\.hh?$")
155154
install(FILES ${WASMTIME_GENERATED_CONF_H}
156-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wasmtime)
155+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wasmtime
156+
COMPONENT Headers)
157157
install(FILES ${WASMTIME_SHARED_FILES} ${WASMTIME_STATIC_FILES}
158158
DESTINATION ${CMAKE_INSTALL_LIBDIR})
159159

@@ -172,3 +172,5 @@ add_custom_target(doc
172172
COMMAND doxygen ${DOXYGEN_CONF_OUT}
173173
DEPENDS ${WASMTIME_GENERATED_CONF_H} ${DOXYGEN_CONF_OUT}
174174
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
175+
add_custom_target(headers
176+
COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component Headers)

crates/c-api/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ fn main() {
5959
// Wasm C API headers.
6060
cfg
6161
.include(std::env::var("DEP_WASMTIME_C_API_INCLUDE").unwrap());
62-
.include(std::env::var("DEP_WASMTIME_C_API_CONF_INCLUDE").unwrap());
6362

6463
// Compile your C code.
6564
cfg

crates/c-api/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ fn main() {
2828
let mut config = cmake::Config::new(&dir);
2929
config
3030
.define("WASMTIME_DISABLE_ALL_FEATURES", "ON")
31-
.build_target("conf_h");
31+
.always_configure(true)
32+
.build_target("headers");
3233
for f in FEATURES {
3334
if env::var_os(format!("CARGO_FEATURE_{}", f)).is_some() {
3435
config.define(format!("WASMTIME_FEATURE_{}", f), "ON");
3536
}
3637
}
3738
let dst = config.build();
3839

39-
println!("cargo:conf-include={}/build/include", dst.display());
40-
println!("cargo:include={}/include", dir.display());
40+
println!("cargo:include={}/include", dst.display());
4141
}

0 commit comments

Comments
 (0)