Skip to content

Commit

Permalink
Set Support system_libs if WIN32, not just MSVC or MINGW (#95505)
Browse files Browse the repository at this point in the history
The previous check was false when compiling with `clang++`, which
prevented `ntdll` from being specified as a link library, causing an
undefined symbol error when trying to resolve `RtlGetLastNtStatus`.
Since we always want to link these libraries on Windows, the check can
be simplified to just `if( WIN32 )`.
  • Loading branch information
z2oh authored Jun 14, 2024
1 parent 005758e commit cc7a18c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(LLVM_ENABLE_ZSTD)
list(APPEND imported_libs ${zstd_target})
endif()

if( MSVC OR MINGW )
if( WIN32 )
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
# advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
# ntdll required for RtlGetLastNtStatus in lib/Support/ErrorHandling.cpp.
Expand Down Expand Up @@ -72,7 +72,7 @@ elseif( CMAKE_HOST_UNIX )
add_compile_definitions(_BSD_SOURCE)
set(system_libs ${system_libs} bsd network)
endif()
endif( MSVC OR MINGW )
endif( WIN32 )

# Delay load shell32.dll if possible to speed up process startup.
set (delayload_flags)
Expand Down

0 comments on commit cc7a18c

Please sign in to comment.