-
Notifications
You must be signed in to change notification settings - Fork 133
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
Allow static library builds #64
Open
jslee02
wants to merge
4
commits into
ros:master
Choose a base branch
from
dartsim:static_build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−5
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
72e61e5
Enable static library building
jslee02 e40bcd8
Add config.h to pass URDFDOM_STATIC definition to client libraries
jslee02 25d4010
Remove unintended lines in CMakeLists.txt and modify logic of setting…
jslee02 6d8e971
Merge remote-tracking branch 'upstream/master' into static_build
jslee02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the definition only here will mean that client binaries that link
urdfdom
as a static library will import the headers withURDFDOM_DLLAPI
set to__declspec(dllimport)
.This at least by inspection of https://github.com/ros/urdfdom/blob/master/urdf_parser/include/urdf_parser/exportdecl.h and knowing that client libraries will not have the
URDFDOM_STATIC
definition set.Are you sure this is ok and not causing linking problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. This cannot resolve the linking problems since the client libraries will not have
URDFDOM_STATIC
.There are two possible ways I can think:
urdfdom.pc
orFindUrdfdom.cmake
exportedcl.h
to define proper preprocessors in the cmake processI'm not sure which one is preferred way.
Edit: It seems
urdfdom.pc
is not generated for Windows though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked how is this implemented in YARP (a library that we use that I am 100% sure that supports building as static library in Windows) and apparently the approach used is the second one that you suggested : https://github.com/robotology/yarp/blob/master/conf/template/yarp_config_api.h.in .
Basically the
exportdecl.h
equivalent file is configured at cmake time and proper definition is added with a#cmakedefine
command.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the guide.
I added distinct
config.h
file instead of configuringexportdecl.h
because I prefer to useconfig.h
file to includes all the definitions configured at cmake time. But I'm fine with usingexportdecl.h
for if this is not a preferable way tourdfdom
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess your approach is sound. 👍