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

perf: faster ament_libraries_deduplicate implementation #530

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions ament_cmake_libraries/ament_cmake_libraries-extras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@
set(AMENT_BUILD_CONFIGURATION_KEYWORD_SEPARATOR ":")

include("${ament_cmake_libraries_DIR}/ament_libraries_deduplicate.cmake")
include("${ament_cmake_libraries_DIR}/ament_libraries_pack_build_configuration.cmake")
include("${ament_cmake_libraries_DIR}/ament_libraries_unpack_build_configuration.cmake")
14 changes: 5 additions & 9 deletions ament_cmake_libraries/cmake/ament_libraries_deduplicate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@
# @public
#
macro(ament_libraries_deduplicate VAR)
ament_libraries_pack_build_configuration(_packed ${ARGN})
set(_unique "")
foreach(_lib ${_packed})
# remove existing value if it exists
list(REMOVE_ITEM _unique ${_lib})
# append value to the end
list(APPEND _unique ${_lib})
endforeach()
ament_libraries_unpack_build_configuration(${VAR} ${_unique})
string(REGEX REPLACE "(^|;)(debug|optimized|general);([^;]+)" "\\1\\2${AMENT_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}\\3" _packed "${ARGN}")
list(REVERSE _packed)
list(REMOVE_DUPLICATES _packed)
list(REVERSE _packed)
string(REGEX REPLACE "(^|;)(debug|optimized|general)${AMENT_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}([^;]+)" "\\1\\2;\\3" ${VAR} "${_packed}")
endmacro()

This file was deleted.

This file was deleted.