-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fix static builds and optimize test compilation #1343
Conversation
Signed-off-by: Addisu Z. Taddese <[email protected]>
e4f081e
to
fc2090b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## sdf12 #1343 +/- ##
=======================================
Coverage 92.14% 92.14%
=======================================
Files 79 79
Lines 13126 13126
=======================================
Hits 12095 12095
Misses 1031 1031 ☔ View full report in Codecov by Sentry. |
src/CMakeLists.txt
Outdated
${CMAKE_CURRENT_SOURCE_DIR} | ||
${PROJECT_SOURCE_DIR}/test | ||
) | ||
if (WIN32) |
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.
if (WIN32) | |
if (WIN32 AND USE_INTERNAL_URDF) |
Unless I miss something, we do not need this if we are using the external urdfdom.
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.
Yup, that makes sense. 5437306
Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
There's a cmake warning related to |
yes, see #1346 (comment) |
Merged and deployed the change. Relaunched the brew -ci-pr_any- job. |
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.
two small nits
TINYXML2::TINYXML2) | ||
target_sources(UNIT_XmlUtils_TEST PRIVATE XmlUtils.cc) | ||
endif() | ||
# Link against the publically and privately linked libraries of the core library |
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.
# Link against the publically and privately linked libraries of the core library | |
# Link against the publicly and privately linked libraries of the core library |
nit: spelling
LIB_DEPS | ||
library_for_tests | ||
TEST_LIST | ||
test_targets |
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.
nit: I don't think test_targets
is used anywhere
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.
oops. I saw this right after I merged. See #1347.
🦟 Bug fix
Alternative to #1309
Summary
As alluded to in #1309, building sdformat with `-DBUILD_SHARED_LIBS=OFF ..' results in the following error
This is because we are creating the
using_parser_urdf
target and linking it against the core library target, which is then exported. When the core library is built as a static library, CMake requires that other targets linked against it are exported as well (see https://stackoverflow.com/a/71080574/283225 case (2)).The solution in this PR is to compile the URDF sources directly into the core library instead of creating an extra target. While working on this, I realized we could create a static library that includes all the extra sources needed for tests instead of building each test with its own extra sources. I believe this will marginally improve compilation time, but more importantly, I think it cleans up the CMake file and will make adding tests easier.
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.