diff options
author | Sharaf Zaman <sharafzaz121@gmail.com> | 2019-04-15 01:05:07 +0530 |
---|---|---|
committer | Sharaf Zaman <sharafzaz121@gmail.com> | 2019-04-15 05:43:22 +0530 |
commit | 24538afeaf610429726c28456ebd8c5bc8652f25 (patch) | |
tree | 4b7f5e117804e42c23342167c919f86913b1f70d | |
parent | 19c99e33bc072e145fae5efd7456e1d782da2264 (diff) | |
download | extra-cmake-modules-24538afeaf610429726c28456ebd8c5bc8652f25.tar.gz extra-cmake-modules-24538afeaf610429726c28456ebd8c5bc8652f25.tar.bz2 |
Detect duplicate ANDROID_EXTRA_LIBS and minor bug fix
Summary:
Don't include same dependency twice, one which was found
from `readelf` in `specifydependencies.cmake` and other in
`ANDROID_EXTRA_LIBS`.
Bug fix: find stl was dependent on the order in which libc++
was added, now it is independent.
Test Plan: * add the same dependency in ANDROID_EXTRA_LIBS
Reviewers: apol, vkrause
Reviewed By: apol
Subscribers: kde-buildsystem, kde-frameworks-devel
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D20509
-rw-r--r-- | toolchain/specifydependencies.cmake | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake index 942e88e2..d21250c1 100644 --- a/toolchain/specifydependencies.cmake +++ b/toolchain/specifydependencies.cmake @@ -21,10 +21,29 @@ foreach(line ${lines}) endif() endforeach() +function(contains_library libpath IS_EQUAL) + get_filename_component (name ${libpath} NAME) + unset (IS_EQUAL PARENT_SCOPE) + + foreach (extralib ${extralibs}) + get_filename_component (extralibname ${extralib} NAME) + if (${extralibname} STREQUAL ${name}) + set (IS_EQUAL TRUE PARENT_SCOPE) + break() + endif() + endforeach() +endfunction() + if (ANDROID_EXTRA_LIBS) foreach (extralib ${ANDROID_EXTRA_LIBS}) - message(STATUS "manually specified extra library: " ${extralib}) - list(APPEND extralibs ${extralib}) + contains_library(${extralib} IS_EQUAL) + + if (IS_EQUAL) + message (STATUS "found duplicate, skipping: " ${extralib}) + else() + message(STATUS "manually specified extra library: " ${extralib}) + list(APPEND extralibs ${extralib}) + endif() endforeach() endif() |