Skip to content

Commit

Permalink
[libc++] Fix how we pass /MANIFEST flag on Windows without clang-cl (l…
Browse files Browse the repository at this point in the history
…lvm#96967)

If we're compiling with Clang (not clang-cl) on Windows, we need to use
-Xlinker to pass the /MANIFEST option.

Fixes llvm#96430
  • Loading branch information
ldionne authored and lravenclaw committed Jul 3, 2024
1 parent 9c63882 commit 51f5644
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libcxx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 51f5644

Please sign in to comment.