Skip to content

Commit

Permalink
bundle wabt objects into libHalide
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Sep 18, 2020
1 parent 26ebef3 commit 2549ba8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dependencies/wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ if (WITH_WABT)
# TODO: we want to require unique prefixes to include these files, to avoid ambiguity;
# this means we have to prefix with "wabt-src/...", which is less bad than other alternatives,
# but perhaps we could do better (esp. if wabt was smarter about what it exposed?)
target_include_directories(wabt INTERFACE
add_library(wabt-obj INTERFACE)
target_sources(wabt-obj INTERFACE $<BUILD_INTERFACE:$<TARGET_OBJECTS:wabt>>)
target_include_directories(wabt-obj INTERFACE
$<BUILD_INTERFACE:${wabt_SOURCE_DIR}>
$<BUILD_INTERFACE:${wabt_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/_deps>)
Expand Down
2 changes: 1 addition & 1 deletion packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(HALIDE_INSTALL_CMAKEDIR
##

set(optional_dependencies "")
foreach (target IN ITEMS wabt)
foreach (target IN ITEMS wabt-shim)
if (TARGET ${target})
list(APPEND optional_dependencies ${target})
endif ()
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ set_target_properties(Halide PROPERTIES

add_dependencies(Halide HalideIncludes)

if (TARGET wabt)
target_link_libraries(Halide PRIVATE wabt)
if (TARGET wabt-obj)
target_link_libraries(Halide PRIVATE wabt-obj)
target_compile_definitions(Halide PRIVATE WITH_WABT)
endif ()

Expand Down

0 comments on commit 2549ba8

Please sign in to comment.