Commit d7efd018 authored by nagayama15's avatar nagayama15

🚧 why error

parent 9cf35632
ExternalProject_Add( ExternalProject_Add(
binaryen binaryen
URL https://github.com/WebAssembly/binaryen/archive/version_72.zip URL https://github.com/WebAssembly/binaryen/archive/1.38.29.tar.gz
PREFIX binaryen PREFIX binaryen
INSTALL_COMMAND "" INSTALL_COMMAND ""
TEST_COMMAND "" TEST_COMMAND ""
CMAKE_ARGS CMAKE_ARGS
-DBUILD_STATIC_LIB=OFF -DBUILD_STATIC_LIB=ON
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
) )
...@@ -14,18 +14,22 @@ ExternalProject_Get_Property(binaryen binary_dir) ...@@ -14,18 +14,22 @@ ExternalProject_Get_Property(binaryen binary_dir)
file(MAKE_DIRECTORY ${source_dir}/src) file(MAKE_DIRECTORY ${source_dir}/src)
add_library(libbinaryen SHARED IMPORTED) add_library(binaryen::binaryen STATIC IMPORTED)
add_dependencies(libbinaryen binaryen) add_dependencies(binaryen::binaryen binaryen)
if (WIN32) set_target_properties(binaryen::binaryen
set(binaryen_SHARED_LIB ${binary_dir}/bin/libbinaryen${CMAKE_SHARED_LIBRARY_SUFFIX})
else ()
set(binaryen_SHARED_LIB ${binary_dir}/lib/libbinaryen${CMAKE_SHARED_LIBRARY_SUFFIX})
endif ()
set_target_properties(libbinaryen
PROPERTIES PROPERTIES
IMPORTED_LOCATION ${binaryen_SHARED_LIB} IMPORTED_LOCATION ${binary_dir}/lib/libpasses.a
IMPORTED_IMPLIB ${binary_dir}/lib/libbinaryen.dll.a
INTERFACE_INCLUDE_DIRECTORIES ${source_dir}/src INTERFACE_INCLUDE_DIRECTORIES ${source_dir}/src
INTERFACE_LINK_LIBRARIES "${binaryen_other_libraries}"
)
target_link_libraries(binaryen::binaryen INTERFACE
${binary_dir}/lib/libwasm.a
${binary_dir}/lib/libasmjs.a
${binary_dir}/lib/libpasses.a
${binary_dir}/lib/libcfg.a
${binary_dir}/lib/libir.a
${binary_dir}/lib/libemscripten-optimizer.a
${binary_dir}/lib/libsupport.a
) )
ExternalProject_Add( ExternalProject_Add(
fmt fmt
URL https://github.com/fmtlib/fmt/archive/5.3.0.zip URL https://github.com/fmtlib/fmt/archive/5.3.0.tar.gz
PREFIX fmt PREFIX fmt
INSTALL_COMMAND "" INSTALL_COMMAND ""
TEST_COMMAND "" TEST_COMMAND ""
...@@ -15,10 +15,10 @@ ExternalProject_Get_Property(fmt binary_dir) ...@@ -15,10 +15,10 @@ ExternalProject_Get_Property(fmt binary_dir)
file(MAKE_DIRECTORY ${source_dir}/include) file(MAKE_DIRECTORY ${source_dir}/include)
add_library(libfmt STATIC IMPORTED) add_library(fmt::fmt STATIC IMPORTED)
add_dependencies(libfmt fmt) add_dependencies(fmt::fmt fmt)
set_target_properties(libfmt set_target_properties(fmt::fmt
PROPERTIES PROPERTIES
IMPORTED_LOCATION ${binary_dir}/libfmt.a IMPORTED_LOCATION ${binary_dir}/libfmt.a
INTERFACE_INCLUDE_DIRECTORIES ${source_dir}/include INTERFACE_INCLUDE_DIRECTORIES ${source_dir}/include
......
...@@ -3,14 +3,6 @@ add_executable(kyut ...@@ -3,14 +3,6 @@ add_executable(kyut
) )
target_link_libraries(kyut target_link_libraries(kyut
libbinaryen binaryen::binaryen
libfmt fmt::fmt
) )
if (WIN32)
add_custom_command(TARGET kyut POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${binaryen_SHARED_LIB}
${CMAKE_CURRENT_BINARY_DIR}
)
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment