Add whole_archive_link support for MSVC.
This issue was discovered by @loic-joly-sonarsource with a proposed fix
in https://github.com/tensorflow/mlir/pull/22.
--
PiperOrigin-RevId: 250558504
This commit is contained in:
committed by
Mehdi Amini
parent
16ebc48c9d
commit
bffba61d48
@@ -25,6 +25,10 @@ function(whole_archive_link target)
|
||||
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})
|
||||
|
||||
Reference in New Issue
Block a user