fix(rosidl_generator_rs_generate_interfaces): Remove poisoning of global CMAKE_SHARED_LINKER_FLAGS variable#22
Conversation
…MAKE_SHARED_LINKER_FLAGS variable I could not find why those lines were there in the first place (they were there since the first version of the repo) but in general CMAKE_* variables are global variables that have a global effect, so unless there is a clear specific motivation, it is better to avoid modifying their value, as it could create side-effects in unrelated part of the CMake project in which this is used.
|
@traversaro thanks for the PR. These variable will only be set while |
Unfortunately side effects are actually happening, due to how In particular So, depending on the order in which the generators are included, a variable set in one generator affects another generator, resulting in cross-talking problems like the one described in ros2/rosidl_python#253 . Anyhow, this PR was opened exactly to understand if there was a motivation for having those lines. If such a motivation is there, I can convert the PR to set |
I tried to do that, but to be honest I am a bit confused: which target in your idea should be affected by those flags? As far as I could see, the generator only generates .rs files, it does not create any library. |
|
@traversaro you're right! Originally the generator created C libraries and they linked against the ROS libraries, but it hasn't done that in a long time. Thanks for the PR, I'll merge the changes right now. |
|
Thanks! |
I could not find why those lines were there in the first place (they were there since the first version of the repo) but in general
CMAKE_*variables are global variables that have a global effect, so unless there is a clear specific motivation, it is better to avoid modifying their value, as it could create side-effects in unrelated part of the CMake project in which this is used, see for example ros2/rosidl_python#253 .