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