Skip to content
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

Decouple linking to shlwapi from BUILD_TESTING #1468

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
TINYXML2::TINYXML2)

if (WIN32)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link against this library only if GZ_ENABLE_RELOCATABLE_INSTALL is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe InstallationDirectories.cc is compiled unconditionally, so I think we can't avoid linking it.

an alternative suggestion from @iche033 in #1414 (comment) is to avoid using shlwapi by copying the joinPaths implementation from gz-common and use std::filesystem

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds like a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated implementation in #1469

PRIVATE shlwapi)
endif()

if (USE_INTERNAL_URDF)
target_include_directories(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/urdf)
Expand Down Expand Up @@ -109,11 +114,6 @@ if (BUILD_TESTING)
-DGZ_SDFORMAT_STATIC_DEFINE
)

if(WIN32)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE shlwapi)
endif()

gz_build_tests(
TYPE UNIT
SOURCES ${gtest_sources}
Expand Down
Loading