LLVM cmake install cannot find DIA SDK

ε祈祈猫儿з 提交于 2019-12-14 02:13:35

问题


I'm trying to build the LLVM install with cmake but it is giving me an error about the LLVM_ENABLE_DIA_SDK. I managed to build LLVM before without PDB's but I am trying to get started with libclang so I need the PDB. Cmake gives me the following error:

CMake Error at cmake/config-ix.cmake:482 (message):
DIA SDK not found. If you have both VS 2012 and 2013 installed, you may
need to uninstall the former and re-install the latter afterwards.
Call Stack (most recent call first):
CMakeLists.txt:575 (include)

I have VS 2014 installed (2015 with update 3) which does have a DIA folder. Could anyone tell me how to point it to the right DIA SDK location?


回答1:


I ran into the same problem today, and Kerry Seitz's answer does work.

Actually, the environment variable VSINSTALLDIR doesn't have to be set manually -- Instead, open the Developer Command Prompt for VS. It will execute a batch script and create the VSINTALLDIR properly. Run CMake within that prompt, then everything will be OK.




回答2:


It looks like LLVM's CMake files assume an environment variable called VSINSTALLDIR.

See: https://github.com/llvm-mirror/llvm/blob/master/cmake/config-ix.cmake#L475

I'm not sure the right way to set this environment variable, but I manually created said environment variable for my user account and set it to the root of my Visual Studio install directory (e.g., C:\Program Files (x86)\Microsoft Visual Studio 14.0\). That fixed the issue for me.

Note: I included a trailing \ in the variable, but I am not sure if it is necessary.



来源:https://stackoverflow.com/questions/44481648/llvm-cmake-install-cannot-find-dia-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!