Changeset View
Changeset View
Standalone View
Standalone View
toolchain/specifydependencies.cmake
Show All 15 Lines | 13 | if(NOT ${currentLib} MATCHES "libQt5.*" AND matched) | |||
---|---|---|---|---|---|
16 | if(ourlib-${currentLib}) | 16 | if(ourlib-${currentLib}) | ||
17 | list(APPEND extralibs "${ourlib-${currentLib}}") | 17 | list(APPEND extralibs "${ourlib-${currentLib}}") | ||
18 | else() | 18 | else() | ||
19 | message(STATUS "could not find ${currentLib} in ${OUTPUT_DIR} ${EXPORT_DIR}/lib/ ${ECM_ADDITIONAL_FIND_ROOT_PATH}") | 19 | message(STATUS "could not find ${currentLib} in ${OUTPUT_DIR} ${EXPORT_DIR}/lib/ ${ECM_ADDITIONAL_FIND_ROOT_PATH}") | ||
20 | endif() | 20 | endif() | ||
21 | endif() | 21 | endif() | ||
22 | endforeach() | 22 | endforeach() | ||
23 | 23 | | |||
24 | function(contains_library libpath IS_EQUAL) | ||||
apol: I'd call the function `contains_library`, as is it looks that it's duplicating something.
Also… | |||||
25 | get_filename_component (name ${libpath} NAME) | ||||
26 | unset (IS_EQUAL PARENT_SCOPE) | ||||
27 | | ||||
28 | foreach (extralib ${extralibs}) | ||||
29 | get_filename_component (extralibname ${extralib} NAME) | ||||
30 | if (${extralibname} STREQUAL ${name}) | ||||
31 | set (IS_EQUAL TRUE PARENT_SCOPE) | ||||
32 | break() | ||||
33 | endif() | ||||
34 | endforeach() | ||||
35 | endfunction() | ||||
36 | | ||||
24 | if (ANDROID_EXTRA_LIBS) | 37 | if (ANDROID_EXTRA_LIBS) | ||
25 | foreach (extralib ${ANDROID_EXTRA_LIBS}) | 38 | foreach (extralib ${ANDROID_EXTRA_LIBS}) | ||
39 | contains_library(${extralib} IS_EQUAL) | ||||
40 | | ||||
41 | if (IS_EQUAL) | ||||
42 | message (STATUS "found duplicate, skipping: " ${extralib}) | ||||
apol: It shouldn't be necessary to set it back again. | |||||
43 | else() | ||||
26 | message(STATUS "manually specified extra library: " ${extralib}) | 44 | message(STATUS "manually specified extra library: " ${extralib}) | ||
27 | list(APPEND extralibs ${extralib}) | 45 | list(APPEND extralibs ${extralib}) | ||
46 | endif() | ||||
28 | endforeach() | 47 | endforeach() | ||
29 | endif() | 48 | endif() | ||
30 | 49 | | |||
31 | if(extralibs) | 50 | if(extralibs) | ||
32 | string(REPLACE ";" "," libs "${extralibs}") | 51 | string(REPLACE ";" "," libs "${extralibs}") | ||
33 | set(extralibs "\"android-extra-libs\": \"${libs}\",") | 52 | set(extralibs "\"android-extra-libs\": \"${libs}\",") | ||
34 | endif() | 53 | endif() | ||
35 | 54 | | |||
Show All 28 Lines |
I'd call the function contains_library, as is it looks that it's duplicating something.
Also pass the output value as an argument instead of magically declaring IS_EQUAL.