This issue was discovered by @loic-joly-sonarsource with a proposed fix
in https://github.com/tensorflow/mlir/pull/22.
--
PiperOrigin-RevId:
250558504
FOREACH(LIB ${ARGN})
string(CONCAT link_flags ${link_flags} "-Wl,-force_load ${CMAKE_BINARY_DIR}/lib/lib${LIB}.a ")
ENDFOREACH(LIB)
+ elseif(MSVC)
+ FOREACH(LIB ${ARGN})
+ string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:${LIB} ")
+ ENDFOREACH(LIB)
else()
set(link_flags "-L${CMAKE_BINARY_DIR}/lib -Wl,--whole-archive,")
FOREACH(LIB ${ARGN})