-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add optional binary relocatability #1968
Conversation
ac3b7be
to
26fb754
Compare
Signed-off-by: Silvio Traversaro <[email protected]>
There is a failure:
|
Probably due to this line: https://github.com/gazebosim/gz-sim/blob/668b757c962e23f33c826487e4f725b3fd4486c5/src/Util.cc#LL823C30-L823C54 . |
Signed-off-by: Silvio Traversaro <[email protected]>
Fixed by 762a382 . |
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #1968 +/- ##
===========================================
- Coverage 65.03% 65.02% -0.01%
===========================================
Files 352 353 +1
Lines 28439 28454 +15
===========================================
+ Hits 18494 18501 +7
- Misses 9945 9953 +8
|
The Jenkins job failed as the test |
Apparently the failure disappeared now, so it was not related to the PR. All checks have passed. |
Thanks a lot @mjcarroll ! |
🎉 New feature
Closes part of #626
Summary
This PR uses the changes introduced in gz-cmake3 in gazebosim/gz-cmake#334 to support the cmake installation directory to be moved after the
make install
prefix, and continue to work without the need to set any special environment variable, as long as the library is compiled as shared. To avoid regressions and problems in Ubuntu Focal due to the use of std::filesystem, this new behaviour is only activated if theGZ_ENABLE_RELOCATABLE_INSTALL
option is enabled, and its default value isOFF
.In particular, this PR defines the:
gz::sim::getGUIConfigPath()
gz::sim::getSystemConfigPath()
gz::sim::getServerConfigPath()
gz::sim::getPluginInstallDir()
gz::sim::getGUIPluginInstallDir()
gz::sim::getWorldInstallDir()
functions that should be used in place of:
GZ_SIM_GUI_CONFIG_PATH
GZ_SIM_SYSTEM_CONFIG_PATH
GZ_SIM_SERVER_CONFIG_PATH
GZ_SIM_PLUGIN_INSTALL_DIR
GZ_SIM_GUI_PLUGIN_INSTALL_DIR
GZ_SIM_WORLD_INSTALL_DIR
macros to ensure that the library is relocatable.
Furthermore, this PR also deprecates the aforementioned macros, using the strategy described in https://stackoverflow.com/a/29297970 . That strategy works fine on GCC and Clang, while on MSVC it raise a warning:
However, I think that it does anyhow the job of raising some kind of warning, and then at soon as the developer checks the macro definition the kind of warning is clear.
Test it
The test should work as usual. The used CMake machinery is tested in gazebosim/gz-cmake#334 .
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.