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

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 28 08:38:28 PDT 2024


Author: Louis Dionne
Date: 2024-06-28T10:38:25-05:00
New Revision: 57dabc1dffdc0181192cf80b79740f50814763a5

URL: https://github.com/llvm/llvm-project/commit/57dabc1dffdc0181192cf80b79740f50814763a5
DIFF: https://github.com/llvm/llvm-project/commit/57dabc1dffdc0181192cf80b79740f50814763a5.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/src/CMakeLists.txt

Removed: 
    


################################################################################
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()
 


        


More information about the libcxx-commits mailing list