Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ros catkin build tool supports the target_compile_options #1146

Open
tareq97-zz opened this issue Jul 1, 2021 · 3 comments
Open

Does ros catkin build tool supports the target_compile_options #1146

tareq97-zz opened this issue Jul 1, 2021 · 3 comments

Comments

@tareq97-zz
Copy link

I am trying to generate the LLVM bitcode for the ROS package. Tried to used the target_compile_options in the CMakeList.txt but it not emitting the llvm bitcode.

Is this option supported or not in the catkin build tool.

Note : Also as per the http://wiki.ros.org/catkin/CMakeLists.txt the option is not supported. Just wanted to confirm regarding this.

@Rayman
Copy link

Rayman commented Jul 1, 2021

catkin_tools just invokes cmake, so you should be able to do anything that you can do with cmake. catkin (this project) is a helper library that makes some parts of compiling projects easier, but not required.

@tareq97-zz
Copy link
Author

tareq97-zz commented Jul 1, 2021

Ok the problem is that while building from catkin. It is using /usr/bin/c++ instead of clang++.
Below is the cmake file which I am using to emit a llvm bitcode for a small sample ros package called testcrash. @Rayman can you please suggest if I am missing anything.

cmake_minimum_required(VERSION 2.8.3)
project(testcrash)
find_package(catkin REQUIRED roscpp std_msgs)
set(CMAKE_C_COMPILER clang++)
catkin_package()
add_executable(testcrash testcrash.cpp)
target_compile_options(testcrash PUBLIC ${CXXMAKE_CXX_FLAGS} -flto)
target_link_libraries(testcrash ${catkin_LIBRARIES})

@Rayman
Copy link

Rayman commented Jul 2, 2021

Probably set(CMAKE_CXX_COMPILER "/path/to/your/cpp/compiler/executable"), but these questions are more suitable for https://answers.ros.org/questions/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants