From 6b003e07df3627beca225f85e983388d862a3c8b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 26 May 2025 10:26:53 +0900 Subject: [PATCH] Revert the location to install public headers This partly reverts "Cmake improvements". (https://github.com/bytecodealliance/wasm-micro-runtime/pull/4076) Recently we changed the location to install public headers. For example, Old: include/wasm_export.h New: include/iwasm/wasm_export.h For cmake-based user applications using find_package(iwasm), the cmake package, namely target_include_directories(INSTALL_INTERFACE), is expected to add necessary compiler options like -isystem automatically. (See samples/printversion for an example of such user applications.) However, in reality, not every user application uses cmake. This commit reverts the location to install public headers for now, to avoid breakage for non-cmake user applications. In case we want to re-apply the location change in future, we should better communicate to the users. (eg. document migration proceduces in release notes.) Fixes: https://github.com/bytecodealliance/wasm-micro-runtime/issues/4290 References: https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html --- CMakeLists.txt | 4 ++-- product-mini/platforms/darwin/CMakeLists.txt | 4 ++-- product-mini/platforms/linux/CMakeLists.txt | 4 ++-- product-mini/platforms/windows/CMakeLists.txt | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 551991f891..0a374b5d5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_target_properties (vmlib PROPERTIES OUTPUT_NAME iwasm) target_include_directories(vmlib INTERFACE $ - $ + $ ) target_link_libraries (vmlib PUBLIC ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl ${CMAKE_THREAD_LIBS_INIT}) @@ -189,7 +189,7 @@ set_version_info (vmlib) install (TARGETS vmlib EXPORT iwasmTargets LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include/iwasm + PUBLIC_HEADER DESTINATION include ) install_iwasm_package () diff --git a/product-mini/platforms/darwin/CMakeLists.txt b/product-mini/platforms/darwin/CMakeLists.txt index 594110a442..cd7c8bc88e 100644 --- a/product-mini/platforms/darwin/CMakeLists.txt +++ b/product-mini/platforms/darwin/CMakeLists.txt @@ -132,7 +132,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_version_info (vmlib) target_include_directories(vmlib INTERFACE - $ + $ ) set (WAMR_PUBLIC_HEADERS @@ -151,7 +151,7 @@ target_link_libraries (vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthr install (TARGETS vmlib EXPORT iwasmTargets DESTINATION lib - PUBLIC_HEADER DESTINATION include/iwasm + PUBLIC_HEADER DESTINATION include ) install_iwasm_package () diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index be0c57edef..cef8329d77 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/product-mini/platforms/linux/CMakeLists.txt @@ -177,7 +177,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_version_info (vmlib) target_include_directories(vmlib INTERFACE - $ + $ ) set (WAMR_PUBLIC_HEADERS @@ -197,7 +197,7 @@ target_link_libraries (vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthr install (TARGETS vmlib EXPORT iwasmTargets DESTINATION lib - PUBLIC_HEADER DESTINATION include/iwasm + PUBLIC_HEADER DESTINATION include ) install_iwasm_package () diff --git a/product-mini/platforms/windows/CMakeLists.txt b/product-mini/platforms/windows/CMakeLists.txt index e0a4e255b9..1a1707f0c3 100644 --- a/product-mini/platforms/windows/CMakeLists.txt +++ b/product-mini/platforms/windows/CMakeLists.txt @@ -147,7 +147,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_version_info (vmlib) target_include_directories(vmlib INTERFACE - $ + $ ) set (WAMR_PUBLIC_HEADERS @@ -174,7 +174,7 @@ endif() install (TARGETS vmlib EXPORT iwasmTargets DESTINATION lib - PUBLIC_HEADER DESTINATION include/iwasm + PUBLIC_HEADER DESTINATION include ) install_iwasm_package ()