简体   繁体   中英

Where is llvm-config in Windows?

I am open to either a Visual Studio answer or a MinGW answer. I just finished building LLVM 3.2 using CMake and Visual Studio 2010. Everything went smoothly, but I have no llvm-config . Do I need it? Every example I see on the intertubes makes use of that tool. If I don't need it, how do I configure my project to make use of LLVM?

To be clear, I am not trying to use LLVM tools/compilers (like clang and whatnot). I am trying to write C++ code that uses the LLVM libraries to produce LLVM IR and even compile that stuff. I setup my include and lib folders. I ran llvm-config in Linux and saw a long list of macros and libraries.

I have a wonderful folder full of goodies. It just has no llvm-config in there: C:\\Program Files (x86)\\LLVM\\

llvm-config does not exist in windows prebuilt binaries. You need to compile from the source code to get it.

  1. Grab CMAKE > 3.5 , install it and make sure you add it to PATH.
  2. Download Visual Studio 2019
  3. Donwload the source code ( 9.0.1 is the latest as I'm writing this)
  4. Extract the source code
  5. Cd into the root of the llvm source-code
  6. In cmd, type cmake . this will generate Visual Studio 2019 sln.
  7. open sln file( LLVM.sln ), change the build type to Rlease, build the whole project
  8. navigate to your Rlease\\bin , and there you have your llvm-config.exe

If you have built the LLVM in debug version all the executables (including llvm-config) have been placed in your build directory (containing Visual Studio project and solution files) in bin/Debug/ subdirectory. In case of release build replace Debug with Release .

If you are interested in using LLVM on Windows more than building it, check out Windows snapshot builds .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM