urdfdom icon indicating copy to clipboard operation
urdfdom copied to clipboard

Allow static library builds

Open jslee02 opened this issue 9 years ago • 10 comments

This PR enables urdfdom to build static libraries by:

  • adding shared/static build option
  • adding URDFDOM_STATIC definition for static build
  • removing explicit build type specification from add_library(~)

This does not change the default build behavior (i.e., shared build) when the build type is not specified.

jslee02 avatar Sep 30 '15 20:09 jslee02

By the way I just noticed that in exportdecl.h a strange console_bridge_EXPORTS macro is used https://github.com/ros/urdfdom/blob/ccc7d2ff6653e190907e5023379b757784a36cea/urdf_parser/include/urdf_parser/exportdecl.h#L77 ... How it is possible that the dll generation works?

traversaro avatar Sep 30 '15 22:09 traversaro

@jslee02 can you resolve conflicts?

scpeters avatar Dec 09 '15 18:12 scpeters

I resolved the conflicts in the latest commit.

console_bridge_EXPORTS seems to need to be specified somewhere. Do we need to add an option for console_bridge_EXPORTS like URDFDOM_STATIC?

jslee02 avatar Dec 09 '15 19:12 jslee02

Should console_bridge_EXPORTS be handled by the console_bridge code?

scpeters avatar Dec 09 '15 19:12 scpeters

I think it should be.

One concern is that the definition console_bridge_EXPORTS wouldn't be passed to the client libraries such as urdfdom. So we might need to pass the definition to console_bridge-config.cmake and console_bridge.pc.in, or create a config.h file in console_bridge and add the definition to config.h.

Alternatively, since URDFDOM_DLLAPI is not used in urdfdom anywhere, so we could consider to remove it.

jslee02 avatar Dec 09 '15 21:12 jslee02

console_bridge_EXPORTS is in include/console_bridge/exportdecl.h, but I don't know why it would be in urdfdom. I'm guessing that @thomas-moulard wrote the console bridge exportdecl.h first then did a search and replace with urdfdom and committed in 75078b81fdefb925c4420283fc590f77d7aee572, but missed a piece? We should probably replace console_bridge_EXPORTS with urdfdom_EXPORTS

scpeters avatar Dec 09 '15 23:12 scpeters

cc @j-rivero we have a question about a weird console_bridge_EXPORTS symbol

scpeters avatar Dec 09 '15 23:12 scpeters

I buy Steve's hypothesis about what Thomas did. He was the first implementing packaging for urdfdom and console_bridge.

Makes no sense to me to mix different variable names in an exportdecl file.

j-rivero avatar Dec 09 '15 23:12 j-rivero

I've submitted #75 to fix console_bridge_EXPORTS

scpeters avatar Jan 31 '16 06:01 scpeters

I am not sure how I introduced this bug but I believe replacing console_bridge_EXPORTS with urdfdom_EXPORTS is the correct solution, sorry for that!

thomas-moulard avatar Feb 01 '16 22:02 thomas-moulard