[LLVMdev] Hi, everyone, fail on building c-index-test

Douglas Gregor dgregor at apple.com
Mon Oct 5 15:30:21 PDT 2009


On Oct 5, 2009, at 3:17 PM, 罗勇刚(Yonggang Luo) wrote:

> Is there anyone get the time to apply this patch?

I've committed my suggested fix. There's no point in setting the  
LINKER_LANGUAGE property of every LLVM library, because CMake figures  
out the right language based on the file extensions of the source files.

	- Doug

> 2009/10/2, Douglas Gregor <dgregor at apple.com>:
>>
>> On Oct 1, 2009, at 6:36 AM, 罗勇刚(Yonggang Luo) wrote:
>>
>>> At the first glance,  it's coming with that c-index-test is just
>>> only containing c files (without cpp(cxx,c++) files).
>>>
>>> So cmake recognize it as pure C project,
>>> and so it's link options that resident in link.txt is
>>> /usr/bin/gcc     CMakeFiles/c-index-test.dir/c-index-test.c.o  -
>>> o ../../../../bin/c-index-test -rdynamic ../../../../lib/
>>> libCIndex.so ../../../../lib/libclangIndex.a ../../../../lib/
>>> libclangFrontend.a ../../../../lib/libclangSema.a ../../../../lib/
>>> libclangAST.a ../../../../lib/libclangLex.a ../../../../lib/
>>> libclangBasic.a ../../../../lib/libLLVMBitReader.a ../../../../lib/
>>> libLLVMMC.a ../../../../lib/libLLVMCore.a ../../../../lib/
>>> libLLVMSupport.a ../../../../lib/libLLVMSystem.a -ldl -lpthread - 
>>> Wl,-
>>> rpath,/home/dreamkxd/llvm/lib
>>>
>>> And so, it's won't linkage with C++ library. So it's failure to
>>> compiling the c-index-test project
>>>
>>> Is there any solution to this problem?
>>
>> You're building using CMake? Try modifying tools/CIndex/ 
>> CMakeLists.txt
>> by adding the following command at the end:
>>
>>   set_target_properties(CIndex
>>     PROPERTIES
>>     LINKER_LANGUAGE CXX)
>>
>> If that works for you, please tell me so I can commit the change to  
>> svn.
>>
>> 	- Doug
>
> -- 
> 从我的移动设备发送
>
>         此致
>> 罗勇刚
> Yours
>    sincerely,
> Yonggang Luo





More information about the llvm-dev mailing list