urdfdom
urdfdom copied to clipboard
Allow static library builds
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.
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?
@jslee02 can you resolve conflicts?
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
?
Should console_bridge_EXPORTS
be handled by the console_bridge code?
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.
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
cc @j-rivero we have a question about a weird console_bridge_EXPORTS
symbol
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.
I've submitted #75 to fix console_bridge_EXPORTS
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!