From 50ea6bed03fcf3b7fbbcf48748b4a6541800fb76 Mon Sep 17 00:00:00 2001 From: Tian Jin Date: Mon, 23 Dec 2019 02:09:11 -0500 Subject: [PATCH] fix build --- MLIR.cmake | 22 +++++++++++----------- src/CMakeLists.txt | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MLIR.cmake b/MLIR.cmake index 7200493..f88745d 100644 --- a/MLIR.cmake +++ b/MLIR.cmake @@ -140,23 +140,23 @@ set(MLIRLibs Threads::Threads) set(MLIRWholeArchiveLibs - MLIRAffineToStandard - MLIRAffineOps - MLIRLLVMIR - MLIRStandardOps - MLIRStandardToLLVM - MLIRTransforms - MLIRLoopToStandard - MLIRVectorOps - MLIRLoopOps) + ${MLIRAffineToStandard} + ${MLIRAffineOps} + ${MLIRLLVMIR} + ${MLIRStandardOps} + ${MLIRStandardToLLVM} + ${MLIRTransforms} + ${MLIRLoopToStandard} + ${MLIRVectorOps} + ${MLIRLoopOps}) function(whole_archive_link target lib_dir) get_property(link_flags TARGET ${target} PROPERTY LINK_FLAGS) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - set(link_flags "${link_flags} -L${lib_dir} ") + set(link_flags "${link_flags} -L${lib_dir} ") foreach(LIB ${ARGN}) string(CONCAT link_flags ${link_flags} - "-Wl,-force_load ${lib_dir}/lib${LIB}.a ") + "-Wl,-force_load,${LIB} ") endforeach(LIB) elseif(MSVC) foreach(LIB ${ARGN}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9cb0488..ef21d2a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,9 +70,9 @@ add_subdirectory(runtime) add_executable(onnf main.cpp) -target_link_libraries(onnf builder compiler ${MLIRLibs} onnf_transform) -whole_archive_link_mlir(onnf ${MLIRWholeArchiveLibs}) +target_link_libraries(onnf builder ${MLIRLibs} onnf_transform) set_target_properties(onnf PROPERTIES LINK_FLAGS "-lz") +whole_archive_link_mlir(onnf ${MLIRWholeArchiveLibs}) target_include_directories(onnf PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories(onnf PRIVATE ${CMAKE_BINARY_DIR})