diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp @@ -379,7 +379,10 @@ const Triple HostTriple(Triple::normalize(LLVM_HOST_TRIPLE)); if (HostTriple.isOSWindows()) { SharedExt = "dll"; - SharedVersionedExt = LLVM_DYLIB_VERSION ".dll"; + if (HostTriple.isWindowsGNUEnvironment()) + SharedVersionedExt = ".dll"; + else + SharedVersionedExt = LLVM_DYLIB_VERSION ".dll"; if (HostTriple.isOSCygMing()) { StaticExt = "a"; StaticPrefix = "lib"; @@ -417,8 +420,10 @@ const bool BuiltSharedLibs = !!LLVM_ENABLE_SHARED; bool DyLibExists = false; + const std::string LlvmName = + HostTriple.isWindowsGNUEnvironment() ? "LLVM" : "LLVM-"; const std::string DyLibName = - (SharedPrefix + "LLVM-" + SharedVersionedExt).str(); + (SharedPrefix + LlvmName + SharedVersionedExt).str(); // If LLVM_LINK_DYLIB is ON, the single shared library will be returned // for "--libs", etc, if they exist. This behaviour can be overridden with