fix build

This commit is contained in:
Tian Jin 2019-12-23 02:09:11 -05:00
parent 238c937f1b
commit 50ea6bed03
2 changed files with 13 additions and 13 deletions

View File

@ -140,23 +140,23 @@ set(MLIRLibs
Threads::Threads) Threads::Threads)
set(MLIRWholeArchiveLibs set(MLIRWholeArchiveLibs
MLIRAffineToStandard ${MLIRAffineToStandard}
MLIRAffineOps ${MLIRAffineOps}
MLIRLLVMIR ${MLIRLLVMIR}
MLIRStandardOps ${MLIRStandardOps}
MLIRStandardToLLVM ${MLIRStandardToLLVM}
MLIRTransforms ${MLIRTransforms}
MLIRLoopToStandard ${MLIRLoopToStandard}
MLIRVectorOps ${MLIRVectorOps}
MLIRLoopOps) ${MLIRLoopOps})
function(whole_archive_link target lib_dir) function(whole_archive_link target lib_dir)
get_property(link_flags TARGET ${target} PROPERTY LINK_FLAGS) get_property(link_flags TARGET ${target} PROPERTY LINK_FLAGS)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") 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}) foreach(LIB ${ARGN})
string(CONCAT link_flags ${link_flags} string(CONCAT link_flags ${link_flags}
"-Wl,-force_load ${lib_dir}/lib${LIB}.a ") "-Wl,-force_load,${LIB} ")
endforeach(LIB) endforeach(LIB)
elseif(MSVC) elseif(MSVC)
foreach(LIB ${ARGN}) foreach(LIB ${ARGN})

View File

@ -70,9 +70,9 @@ add_subdirectory(runtime)
add_executable(onnf main.cpp) add_executable(onnf main.cpp)
target_link_libraries(onnf builder compiler ${MLIRLibs} onnf_transform) target_link_libraries(onnf builder ${MLIRLibs} onnf_transform)
whole_archive_link_mlir(onnf ${MLIRWholeArchiveLibs})
set_target_properties(onnf PROPERTIES LINK_FLAGS "-lz") 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_SOURCE_DIR})
target_include_directories(onnf PRIVATE ${CMAKE_BINARY_DIR}) target_include_directories(onnf PRIVATE ${CMAKE_BINARY_DIR})