Skip to content

Commit 57dabc1

Browse files
authored
[libc++] Fix how we pass /MANIFEST flag on Windows without clang-cl (#96967)
If we're compiling with Clang (not clang-cl) on Windows, we need to use -Xlinker to pass the /MANIFEST option. Fixes #96430
1 parent 0cc3fe4 commit 57dabc1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libcxx/src/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,13 @@ if (LIBCXX_ENABLE_SHARED)
275275
# Since we most likely do not have a mt.exe replacement, disable the
276276
# manifest bundling. This allows a normal cmake invocation to pass which
277277
# will attempt to use the manifest tool to generate the bundled manifest
278-
set_target_properties(cxx_shared PROPERTIES
279-
APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO")
278+
if (${CMAKE_CXX_COMPILER_FRONTEND_VARIANT} STREQUAL "MSVC")
279+
set_target_properties(cxx_shared PROPERTIES
280+
APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO")
281+
else()
282+
set_target_properties(cxx_shared PROPERTIES
283+
APPEND_STRING PROPERTY LINK_FLAGS " -Xlinker /MANIFEST:NO")
284+
endif()
280285
endif()
281286
endif()
282287

0 commit comments

Comments
 (0)