From 51f564478eafb590305c724941b46e567a7b3f74 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 28 Jun 2024 10:38:25 -0500 Subject: [PATCH] [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 --- libcxx/src/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 9e6c70335a7940..8ba6f00bf9dad5 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -275,8 +275,13 @@ if (LIBCXX_ENABLE_SHARED) # Since we most likely do not have a mt.exe replacement, disable the # manifest bundling. This allows a normal cmake invocation to pass which # will attempt to use the manifest tool to generate the bundled manifest - set_target_properties(cxx_shared PROPERTIES - APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO") + if (${CMAKE_CXX_COMPILER_FRONTEND_VARIANT} STREQUAL "MSVC") + set_target_properties(cxx_shared PROPERTIES + APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO") + else() + set_target_properties(cxx_shared PROPERTIES + APPEND_STRING PROPERTY LINK_FLAGS " -Xlinker /MANIFEST:NO") + endif() endif() endif()