Skip to content

[MSVC] hardcode path in LLVMExports.cmake of clang+llvm-18.1.8-x86_64-pc-windows-msvc #100372

@ACWhaleN

Description

@ACWhaleN

When I coding under GCC(amd64, Windows11) by using the chooseMSVCCRT macro, diaguids.lib is implicitly imported. And because the L476 of LLVMExports.cmake in the lib\cmake\llvm folder uses an absolute path, my program fails to build.

lib\cmake\llvm\LLVMExports.cmake: L475~L477

set_target_properties(LLVMDebugInfoPDB PROPERTIES
  INTERFACE_LINK_LIBRARIES "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK/lib/amd64/diaguids.lib;LLVMBinaryFormat;LLVMObject;LLVMSupport;LLVMDebugInfoCodeView;LLVMDebugInfoMSF"
)

biuld-logs:

[ 30%] Building CXX object test/CMakeFiles/qcc.dir/__/src/Parser/Type.cpp.obj
mingw32-make.exe[3]: *** No rule to make target 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK/lib/amd64/diaguids.lib', needed by 'test/qcc.exe'.  Stop.
mingw32-make.exe[3]: *** Waiting for unfinished jobs....

(when I use ninja)

ninja: error: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK/lib/amd64/diaguids.lib', needed by 'test/qcc.exe', missing and no known rule to make it.

In fact, I have never used Microsoft Visual Studio 2019 Professional.

The problem was solved when I switched to LLVM installed with pacman in msys2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions