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

support building separate debug and release targets #87

Closed
geoffviola opened this issue Mar 18, 2017 · 4 comments
Closed

support building separate debug and release targets #87

geoffviola opened this issue Mar 18, 2017 · 4 comments
Labels
enhancement New feature or request more-information-needed Further information is required

Comments

@geoffviola
Copy link

Continuing on the thread from https://groups.google.com/forum/#!topic/ros-sig-ng-ros/bhAMgFCIOnE, MSVC has a powerful debugger but ament makes it difficult to use it. Running in RelWithDebInfo mode allows basic debugging, but it diminishes the utility of Visual Studio: https://github.com/geoffviola/undefined_behavior_study.

It would be nice if ament named libraries differently based on the CMAKE_BUILD_TYPE. Boost libraries have a standard on suffixes it applies to libraries: http://www.boost.org/doc/libs/1_63_0/more/getting_started/windows.html#library-naming. Also, conan addressed this problem: conan-io/conan#330.

Maybe, when the a library is exported, it does something like

set_target_properties(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "D")
set_target_properties(${TARGET_NAME} PROPERTIES RELEASE_POSTFIX "S")    
@dirk-thomas
Copy link
Contributor

dirk-thomas commented Mar 18, 2017

I think this is in the responsibility of each packages CMake code to use build type specific suffixes (and make sure to export them accordingly). I am not sure how ament_cmake could do that generically.

Also if you build a workspace with e.g. CMAKE_BUILD_TYPE=Debug you should be able to leverage the full potential of the Visual Studio debugger without the need for any changes.

@geoffviola
Copy link
Author

Maybe, this isn't the best place to put this request. I mostly want to see all the ROS 2 packages in https://github.com/ros2/ros2/blob/master/ros2.repos have standard library suffixes based on CMAKE_BUILD_TYPE. That way the libraries can be built in Debug mode and Release mode without clobbering the other artifacts.

ament_target_dependencies would need know which artifact to chose. Also, the ROS 2 Windows binary should include both the debug and release libraries.

@dirk-thomas
Copy link
Contributor

If a package builds both library types at the same type it can export something like this: release libfoo debug libfood. But that is rather uncommon for a CMake project. If a package only builds one build type at a type it can also only export that library.

So I am not sure how you would like to achieve this. Maybe it would be best to propose a few PRs to some lower level packages. And if the approach works well the same approach can be considered for all other packages.

@dirk-thomas dirk-thomas added the more-information-needed Further information is required label May 22, 2017
@dirk-thomas dirk-thomas changed the title Support Visual Studio debugger support building separate debug and release targets Aug 3, 2017
@dirk-thomas dirk-thomas added the enhancement New feature or request label Aug 3, 2017
@mikaelarguedas
Copy link
Contributor

@geoffviola Closing this due to inactivity and lack of a clear path forward. Feel free to keep commenting on the issue and we can reopen it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

3 participants