罗勇刚(Yonggang Luo)
2009-Oct-05 22:17 UTC
[LLVMdev] Hi, everyone, fail on building c-index-test
Is there anyone get the time to apply this patch? 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
Douglas Gregor
2009-Oct-05 22:30 UTC
[LLVMdev] Hi, everyone, fail on building c-index-test
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
罗勇刚(Yonggang Luo)
2009-Oct-07 14:57 UTC
[LLVMdev] Hi, everyone, fail on building c-index-test
> > 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.Yes, CMake figures out the *right language* based on the file extensions of the source files. But, llvm is based on *C++* for example, if you create a application just containing *C *extension files, but using llvm as the midware, then CMake system *must *auto recognize the LINKER_LANGUAGE as CXX, but not C. Even all source files in this project is C extension. Now, it's using a strange hack, just set_target_properties(c-index-test PROPERTIES LINKER_LANGUAGE CXX) It's not reasonable, because it's not because of c-index-test.c lead the LINKER_LANGUAGE to be CXX but llvm make this happened, so it's shouldn't be placed at c-index-test.c/CMakeLists.txt *and should be placed at * AddLLVM.cmake That's means, every *new project(OR executable)* using LLVM as the dependent, then then LINKER_LANGUAGE must be set to CXX in an auto way, but not set it manually. -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091007/0f52982b/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Hi, everyone, fail on building c-index-test
- [LLVMdev] Hi, everyone, fail on building c-index-test
- [LLVMdev] Hi, people, I propose to move Debug and Object File related headers out of Support
- [LLVMdev] Hi, people, I propose to move Debug and Object File related headers out of Support
- [LLVMdev] Hi, people, I propose to move Debug and Object File related headers out of Support