[LLVMdev] LLVM Cmake module?

Óscar Fuentes ofv at wanadoo.es
Wed Nov 3 12:30:30 PDT 2010


Eli Gottlieb <eligottlieb at gmail.com> writes:

> I compiled and installed it to the prefix /usr, but that's not the
> issue.  Once I actually compile and install LLVM with CMake by hand, I
> get the share/llvm/cmake stuff installed correctly (can those files be
> included in "normal" builds, or will LLVM switch to CMake as its
> primary build system?).  Now I'm running into the problem of cflags or
> includes or something not being set properly.

[snip]

>> [  9%] Building C object CMakeFiles/jllvm.dir/Analysis_wrap.c.o
>> In file included from /usr/include/llvm-c/Core.h:36,
>>                  from /usr/include/llvm-c/Analysis.h:22,
>>                  from
>> /home/eli/Programs/decac/src/jllvm/llvm/Analysis_wrap.c:190:
>> /usr/include/llvm/System/DataTypes.h:46: error: #error "Must #define
>> __STDC_LIMIT_MACROS before #including System/DataTypes.h"
>> /usr/include/llvm/System/DataTypes.h:50: error: #error "Must #define
>> __STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
>> make[2]: *** [CMakeFiles/jllvm.dir/Analysis_wrap.c.o] Error 1
>> make[1]: *** [CMakeFiles/jllvm.dir/all] Error 2
>> make: *** [all] Error 2

Yes, you must define __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS on
your CMakeLists.txt. Put this before any add_executable/add_library that
contains source files that uses LLVM stuff:

add_definitions( -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS )



More information about the llvm-dev mailing list