cmake + llvm : issue when embedding llvm

Hi everybody,

I’m trying to build my own project that use LLVM. I downloaded the source code and the pre-compiled package on the official web site (last version):

I downloaded the following : LLVM source code Clang for Windows (64-bit) FYI, I don’t build LLVM… only want to use it ! I followed the instruction here ( ), in the section : “Embedding LLVM in your project”. So, I added this code into my cmake file : find_package(LLVM REQUIRED CONFIG) message(STATUS “Found LLVM ${LLVM_PACKAGE_VERSION}”) message(STATUS “Using LLVMConfig.cmake in: ${LLVM_DIR}”) message(“LLVM_INCLUDE_DIRS=${LLVM_INCLUDE_DIRS}”) message(“LLVM_DEFINITIONS=${LLVM_DEFINITIONS}”) But I got several cmake error messages, here is my output : – Using LLVMConfig.cmake in: C:\Luciad_src\libs\LLVM\cmake\modules LLVM_INCLUDE_DIRS= LLVM_DEFINITIONS= CMake Error at C:/Luciad_src/libs/LLVM/cmake/modules/LLVM-Config.cmake:31 (list): list sub-command REMOVE_ITEM requires two or more arguments. Call Stack (most recent call first): C:/Luciad_src/libs/LLVM/cmake/modules/LLVM-Config.cmake:256 (is_llvm_target_library) components/query/CMakeLists.txt:15 (llvm_map_components_to_libnames) Is there a problem with my script, or the packages I use ? Any idea ? Thanks for your help

Hi Christophe,

I didn’t fully get your setup. Is C:/Luciad_src/libs/LLVM where you unpacked the sources? Or is that a build or install tree? If it is the former, and your errors suggest that it is, then that’s not how this works!

You need to point CMake to a built version of LLVM.

Now, I’m not familiar with the windows packaging, so I can’t tell you whether the binaries you downloaded already contained what you need. Someone who’s more familiar with the windows environment should chime in here. On Linux at least there are dev packages available for this purpose, so it’s possible the windows distribution contains something like that.

Cheers,
Philip

Hi Christophe,

please keep this discussion on the list (re-added), so others can correct me if I’m wrong or am giving bad advice.

If there is no dev package included or available for windows, then this means that you need to build LLVM yourself, I"m afraid.

Cheers,
Philip

Thanks,

I can rebuild… but then why do they provide a pre-build package ?

And anyway, I should continue to have the same cmake issue, right ?

I can rebuild... but then why do they provide a pre-build package ?

Apparently there is no pre-build dev package for windows, so building
yourself is your only option.

And anyway, I should continue to have the same cmake issue, right ?

Which cmake issues precisely? The ones you mentioned in your original
email are purely caused by you not using a built LLVM.

Cheers,
Philip