Open ThosRTanner opened 7 months ago
I don't think building against the .lib files in that package is likely to work in general. If anyone wants to try to make it work, patches are welcome.
I don't think building against the .lib files in that package is likely to work in general. If anyone wants to try to make it work, patches are welcome.
I'm sorry, I think I misread OP's question: using the package to build "include-what-you-use", and CMake doesn't find diaguids.lib from Visual Studio 2022's DIA SDK but strangely refer to Visual Studio 2019's.
@ThosRTanner I think you need to run CMake under "x64 Native Tools Command Prompt for VS 2022" (or similar) to correct set build environments for Visual Studio's DIA SDK. So, maybe this is not a LLVM problem or some CMake files in the package hard-coded MSVC_DIA_SDK_DIR
, need time to check.
I find following (line 475 to 478) from clang+llvm-18.1.2-x86_64-pc-windows-msvc\lib\cmake\llvm\LLVMExports.cmake
:
# Create imported target LLVMDebugInfoPDB
add_library(LLVMDebugInfoPDB STATIC IMPORTED)
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"
)
That looks very like a hardcoded reference that I can't avoid however I build.
ok this can be fixed via
- name: install DIA SDK
run: |
set -x
mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true
cp -rv "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK"
ok this can be fixed via
- name: install DIA SDK run: | set -x mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true cp -rv "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK"
- name: install DIA SDK
if: runner.os == 'Windows'
shell: bash
run: |
set -x
mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true
cp -rv "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK"
So other than copying from where it is on the current machine to where LLVM expects it to be, what's the fix here?
Trying to build a cmake project with visual studio 2022 community after unpacking "clang+llvm-18.1.2-x86_64-pc-windows-msvc.tar.xz" results in this output:
Build failed.