Skip to content

Commit

Permalink
Do not add duplicates to the list.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcojean committed Apr 13, 2022
1 parent fee3be7 commit cbd70da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/ginkgo.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Version: @Ginkgo_VERSION@
URL: https://ginkgo-project.github.io/

Requires:
Libs: @GINKGO_INTERFACE_LINK_FLAGS@
Libs: @GINKGO_INTERFACE_LINK_FLAGS@
Cflags: @GINKGO_INTERFACE_CXX_FLAGS@
10 changes: 6 additions & 4 deletions cmake/information_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function(filter_generator_expressions INPUT OUTPUT)
# without (v3.16.x). Sometimes, it also has extra arguments. We need to do
# at least a greedy regex also consuming the final `>` if present before
# doing a non greedy one for the leftovers.
string(REGEX REPLACE "[$<A-Z_:]+SHELL:(.+)[>]+" "\\1" TMP "${TMP}")
string(REGEX REPLACE "[$<A-Z_:]*SHELL:(.+)[>]*" "\\1" TMP "${TMP}")
string(REGEX REPLACE "[$<A-Z_:]+SHELL:(.+)>+" "\\1" TMP "${TMP}")
string(REGEX REPLACE "[$<A-Z_:]*SHELL:(.+)>*" "\\1" TMP "${TMP}")
string(REGEX REPLACE ".+INTERFACE:.+>" "" TMP "${TMP}")
string(REGEX REPLACE "\$<COMMA>" "," TMP "${TMP}")
# Ignore hwloc include if it is the internal one
Expand All @@ -32,8 +32,8 @@ macro(ginkgo_interface_libraries_recursively INTERFACE_LIBS)
if (GINKGO_INTERFACE_LIBS_LINK_FLAGS)
filter_generator_expressions("${GINKGO_INTERFACE_LIBS_LINK_FLAGS}"
GINKGO_INTERFACE_LIB_NAME)
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "${GINKGO_INTERFACE_LIB_NAME}")
elseif (NOT "${GINKGO_INTERFACE_LIB_NAME}" IN_LIST GINKGO_INTERFACE_LIBS_FOUND)
endif()
if (NOT "${GINKGO_INTERFACE_LIB_NAME}" IN_LIST GINKGO_INTERFACE_LIBS_FOUND)
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "${GINKGO_INTERFACE_LIB_NAME}")
endif()

Expand Down Expand Up @@ -97,13 +97,15 @@ macro(ginkgo_interface_information)

# Format and store the interface libraries found
list(REMOVE_DUPLICATES GINKGO_INTERFACE_LIBS_FOUND)
list(REMOVE_ITEM GINKGO_INTERFACE_LIBS_FOUND "")
string(REPLACE ";" " "
GINKGO_FORMATTED_INTERFACE_LIBS_FOUND "${GINKGO_INTERFACE_LIBS_FOUND}")
set(GINKGO_INTERFACE_LINK_FLAGS
"${GINKGO_INTERFACE_LINK_FLAGS} ${GINKGO_FORMATTED_INTERFACE_LIBS_FOUND}")
unset(GINKGO_INTERFACE_LIBS_FOUND)
# Format and store the interface cflags found
list(REMOVE_DUPLICATES GINKGO_INTERFACE_CFLAGS_FOUND)
list(REMOVE_ITEM GINKGO_INTERFACE_CFLAGS_FOUND "")
string(REPLACE ";" " "
GINKGO_FORMATTED_INTERFACE_CFLAGS_FOUND "${GINKGO_INTERFACE_CFLAGS_FOUND}")
set(GINKGO_INTERFACE_CXX_FLAGS "${GINKGO_FORMATTED_INTERFACE_CFLAGS_FOUND}")
Expand Down

0 comments on commit cbd70da

Please sign in to comment.