summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-06-28 10:38:25 -0500
committerGitHub <noreply@github.com>2024-06-28 10:38:25 -0500
commit57dabc1dffdc0181192cf80b79740f50814763a5 (patch)
treec2a33f04d9d205078b71da85f556a082110fdafe
parent0cc3fe460105c4c0c78139d7a78da557c3502298 (diff)
[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
-rw-r--r--libcxx/src/CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 9e6c70335a79..8ba6f00bf9da 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()