Skip to content

Commit 782c69f

Browse files
authored
Revert the location to install public headers (#4295)
This partly reverts "Cmake improvements". (#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: #4290 References: https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html
1 parent 21bcf5c commit 782c69f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
160160
set_target_properties (vmlib PROPERTIES OUTPUT_NAME iwasm)
161161
target_include_directories(vmlib INTERFACE
162162
$<BUILD_INTERFACE:${WAMR_ROOT_DIR}/core/iwasm/include>
163-
$<INSTALL_INTERFACE:include/iwasm>
163+
$<INSTALL_INTERFACE:include>
164164
)
165165

166166
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)
189189
install (TARGETS vmlib
190190
EXPORT iwasmTargets
191191
LIBRARY DESTINATION lib
192-
PUBLIC_HEADER DESTINATION include/iwasm
192+
PUBLIC_HEADER DESTINATION include
193193
)
194194

195195
install_iwasm_package ()

product-mini/platforms/darwin/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
132132
set_version_info (vmlib)
133133

134134
target_include_directories(vmlib INTERFACE
135-
$<INSTALL_INTERFACE:include/iwasm>
135+
$<INSTALL_INTERFACE:include>
136136
)
137137

138138
set (WAMR_PUBLIC_HEADERS
@@ -151,7 +151,7 @@ target_link_libraries (vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthr
151151
install (TARGETS vmlib
152152
EXPORT iwasmTargets
153153
DESTINATION lib
154-
PUBLIC_HEADER DESTINATION include/iwasm
154+
PUBLIC_HEADER DESTINATION include
155155
)
156156

157157
install_iwasm_package ()

product-mini/platforms/linux/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
177177
set_version_info (vmlib)
178178

179179
target_include_directories(vmlib INTERFACE
180-
$<INSTALL_INTERFACE:include/iwasm>
180+
$<INSTALL_INTERFACE:include>
181181
)
182182

183183
set (WAMR_PUBLIC_HEADERS
@@ -197,7 +197,7 @@ target_link_libraries (vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthr
197197
install (TARGETS vmlib
198198
EXPORT iwasmTargets
199199
DESTINATION lib
200-
PUBLIC_HEADER DESTINATION include/iwasm
200+
PUBLIC_HEADER DESTINATION include
201201
)
202202

203203
install_iwasm_package ()

product-mini/platforms/windows/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
147147
set_version_info (vmlib)
148148

149149
target_include_directories(vmlib INTERFACE
150-
$<INSTALL_INTERFACE:include/iwasm>
150+
$<INSTALL_INTERFACE:include>
151151
)
152152

153153
set (WAMR_PUBLIC_HEADERS
@@ -174,7 +174,7 @@ endif()
174174
install (TARGETS vmlib
175175
EXPORT iwasmTargets
176176
DESTINATION lib
177-
PUBLIC_HEADER DESTINATION include/iwasm
177+
PUBLIC_HEADER DESTINATION include
178178
)
179179

180180
install_iwasm_package ()

0 commit comments

Comments
 (0)