Commit d8fdb96c authored by nagayama15's avatar nagayama15

Fix CMake settings for Linux target

parent fb16aa7c
......@@ -17,11 +17,15 @@ file(MAKE_DIRECTORY ${source_dir}/src)
add_library(libbinaryen SHARED IMPORTED)
add_dependencies(libbinaryen binaryen)
set(binaryen_SHARED_LIB ${binary_dir}/bin/libbinaryen${CMAKE_SHARED_LIBRARY_SUFFIX})
if (WIN32)
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
IMPORTED_LOCATION ${binaryen_SHARED_LIB}
IMPORTED_IMPLIB ${binary_dir}/lib/libbinaryen${CMAKE_SHARED_LIBRARY_SUFFIX}.a
IMPORTED_IMPLIB ${binary_dir}/lib/libbinaryen.dll.a
INTERFACE_INCLUDE_DIRECTORIES ${source_dir}/src
)
......@@ -6,8 +6,10 @@ target_link_libraries(kyut
libbinaryen
)
add_custom_command(TARGET kyut POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${binaryen_SHARED_LIB}
${CMAKE_CURRENT_BINARY_DIR}
)
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