[libcxx-commits] [libcxx] [libc++] Fix how we pass /MANIFEST flag on Windows without clang-cl (PR #96967)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 27 14:00:52 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

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

Fixes #<!-- -->96430

---
Full diff: https://github.com/llvm/llvm-project/pull/96967.diff


1 Files Affected:

- (modified) libcxx/src/CMakeLists.txt (+7-2) 


``````````diff
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 9e6c70335a794..8ba6f00bf9dad 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()
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/96967


More information about the libcxx-commits mailing list