Skip to content

Commit 206fb5d

Browse files
committed
fix whole-archive link
1 parent 50ea6be commit 206fb5d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

MLIR.cmake

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,23 @@ set(MLIRLibs
140140
Threads::Threads)
141141

142142
set(MLIRWholeArchiveLibs
143-
${MLIRAffineToStandard}
144-
${MLIRAffineOps}
145-
${MLIRLLVMIR}
146-
${MLIRStandardOps}
147-
${MLIRStandardToLLVM}
148-
${MLIRTransforms}
149-
${MLIRLoopToStandard}
150-
${MLIRVectorOps}
151-
${MLIRLoopOps})
143+
MLIRAffineToStandard
144+
MLIRAffineOps
145+
MLIRLLVMIR
146+
MLIRStandardOps
147+
MLIRStandardToLLVM
148+
MLIRTransforms
149+
MLIRLoopToStandard
150+
MLIRVectorOps
151+
MLIRLoopOps)
152152

153153
function(whole_archive_link target lib_dir)
154154
get_property(link_flags TARGET ${target} PROPERTY LINK_FLAGS)
155155
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
156156
set(link_flags "${link_flags} -L${lib_dir} ")
157157
foreach(LIB ${ARGN})
158158
string(CONCAT link_flags ${link_flags}
159-
"-Wl,-force_load,${LIB} ")
159+
"-Wl,-force_load, ${lib_dir}/lib${LIB}.a ")
160160
endforeach(LIB)
161161
elseif(MSVC)
162162
foreach(LIB ${ARGN})
@@ -177,9 +177,9 @@ function(whole_archive_link_mlir target)
177177
endfunction(whole_archive_link_mlir)
178178

179179
function(whole_archive_link_onnf target)
180-
foreach(LIB ${ARGN})
181-
add_dependencies(${target} ${LIB})
182-
endforeach(LIB)
180+
foreach(lib_target ${ARGN})
181+
add_dependencies(${target} ${lib_target})
182+
endforeach(lib_target)
183183
whole_archive_link(${target} ${CMAKE_BINARY_DIR}/lib ${ARGN})
184184
endfunction(whole_archive_link_onnf)
185185

0 commit comments

Comments
 (0)