Cmake_link_script

broken image


  1. Cmake Linker
  2. Cmake_link_script
On Mon, Oct 8, 2012 at 10:40 PM, James Bigler <[hidden email]>
Cmake_link_script
wrote:
Cmake_link_script
Cmake_link_script

Hello everyone, I am working my way through the 5 Days ROS course with Python. I am in unit 5 (Services-Client) now. Along the way, I have created dummy packages to do some practice. Output of the CMakeOutput.log file. The target system is: Generic - 1 - The host system is: Linux - 5.4.0-42-generic - x8664 Compiling the C compiler identification source file 'CMakeCCompilerId.c' succeeded. 2012/10/9 James Bigler: In my project I need to manually link against a special version of libstdc, so I manually set the target link language to C and then add my special library to the link line. On Linux this seems to work just finebut on OSX it still add -lstdc to the link like. Here's my cmake code: This doesn't seem to work on Linux either on my side.


Cmake_link_script
In my project I need to manually link against a special version of libstdc++, so I manually set the target link language to C and then add my special library to the link line. On Linux this seems to work just fine, but on OSX it still add -lstdc++ to the link like. Here's my cmake code:

@Anna Falevskaya. HI,thanks for your answer,but i think it's not the problem. My problem is that when the cmake test gcc.exe,it has created temp folder,but didn't create temp c file,and the cmke even try to complile the temp file which didn't exist.It looks really ridiculous. Linking CXX executable mysqld: cd /home/buildbot/5.5-cassandra/sql && /usr/bin/cmake -E cmakelinkscript CMakeFiles/mysqld.dir/link.txt -verbose=1.

project(linking_fun)
add_library(a SHARED a.cpp)
set_target_properties(a PROPERTIES LINKER_LANGUAGE 'C')
add_library(b SHARED b.c)
a.cpp and b.c both simply have 'int foo() { return 3;}'

And here's the compiler output which has the -lstdc++ on the link line for library a, but not for library b.
Cmake_link_script
wrote:

Hello everyone, I am working my way through the 5 Days ROS course with Python. I am in unit 5 (Services-Client) now. Along the way, I have created dummy packages to do some practice. Output of the CMakeOutput.log file. The target system is: Generic - 1 - The host system is: Linux - 5.4.0-42-generic - x8664 Compiling the C compiler identification source file 'CMakeCCompilerId.c' succeeded. 2012/10/9 James Bigler: In my project I need to manually link against a special version of libstdc, so I manually set the target link language to C and then add my special library to the link line. On Linux this seems to work just finebut on OSX it still add -lstdc to the link like. Here's my cmake code: This doesn't seem to work on Linux either on my side.


In my project I need to manually link against a special version of libstdc++, so I manually set the target link language to C and then add my special library to the link line. On Linux this seems to work just fine, but on OSX it still add -lstdc++ to the link like. Here's my cmake code:

@Anna Falevskaya. HI,thanks for your answer,but i think it's not the problem. My problem is that when the cmake test gcc.exe,it has created temp folder,but didn't create temp c file,and the cmke even try to complile the temp file which didn't exist.It looks really ridiculous. Linking CXX executable mysqld: cd /home/buildbot/5.5-cassandra/sql && /usr/bin/cmake -E cmakelinkscript CMakeFiles/mysqld.dir/link.txt -verbose=1.

project(linking_fun)
add_library(a SHARED a.cpp)
set_target_properties(a PROPERTIES LINKER_LANGUAGE 'C')
add_library(b SHARED b.c)
a.cpp and b.c both simply have 'int foo() { return 3;}'

And here's the compiler output which has the -lstdc++ on the link line for library a, but not for library b.
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/a.dir/link.txt --verbose=1
/usr/bin/gcc -dynamiclib -Wl,-headerpad_max_install_names -o liba.dylib -install_name /Users/jbigler/code/temp/cmake/static-libstdcpp/liba.dylib CMakeFiles/a.dir/a.cpp.o -lstdc++ /usr/bin/../lib/clang/4.0/lib/darwin/libclang_rt.osx.a
/opt/local/bin/cmake -E cmake_progress_report /Users/jbigler/code/temp/cmake/static-libstdcpp/CMakeFiles 1

Cmake Linker

make -f CMakeFiles/b.dir/build.make CMakeFiles/b.dir/depend
cd /Users/jbigler/code/temp/cmake/static-libstdcpp && /opt/local/bin/cmake -E cmake_depends 'Unix Makefiles' /Users/jbigler/code/temp/cmake/static-libstdcpp /Users/jbigler/code/temp/cmake/static-libstdcpp /Users/jbigler/code/temp/cmake/static-libstdcpp /Users/jbigler/code/temp/cmake/static-libstdcpp /Users/jbigler/code/temp/cmake/static-libstdcpp/CMakeFiles/b.dir/DependInfo.cmake --color=
make -f CMakeFiles/b.dir/build.make CMakeFiles/b.dir/build
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/b.dir/link.txt --verbose=1

Cmake_link_script

/usr/bin/gcc -dynamiclib -Wl,-headerpad_max_install_names -o libb.dylib -install_name /Users/jbigler/code/temp/cmake/static-libstdcpp/libb.dylib CMakeFiles/b.dir/b.c.o
Is this a bug or a 'feature'?
James




broken image