Closed Dushistov closed 4 years ago
I removed CoreBluetooth from QT_EXTRA_LIBS
and that made Apple Store happy.
May be some option to remove it?
QT_EXTRA_LIBS is the ugly part of the script. Just putting everything in there to have something that work. Thanks for the feedback. Maybe it should only be appended if user is linking with Qt5 Bluetooth.
get_target_property(TARGET_DEPENDENCIES ${QT_IOS_TARGET} LINK_LIBRARIES)
foreach(TARGET_DEPENDENCY ${TARGET_DEPENDENCIES})
if(${TARGET_DEPENDENCY} STREQUALS "Qt5::Bluetooth")
set(QT_EXTRA_LIBS "${QT_EXTRA_LIBS} -framework CoreBluetooth")
endif()
endforeach()
@OlivierLDff
But why QT_EXTRA_LIBS
exists at the first place?
For example
~/Qt/5.15.0/ios/lib/cmake/Qt5Bluetooth/Qt5BluetoothConfig.cmake contains code:
if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES)
_qt5_Bluetooth_process_prl_file(
"${_qt5Bluetooth_install_prefix}/lib/libQt5Bluetooth_debug.prl" DEBUG
_Qt5Bluetooth_STATIC_DEBUG_LIB_DEPENDENCIES
_Qt5Bluetooth_STATIC_DEBUG_LINK_FLAGS
)
_qt5_Bluetooth_process_prl_file(
"${_qt5Bluetooth_install_prefix}/lib/libQt5Bluetooth.prl" RELEASE
_Qt5Bluetooth_STATIC_RELEASE_LIB_DEPENDENCIES
_Qt5Bluetooth_STATIC_RELEASE_LINK_FLAGS
)
endif()
where libQt5Bluetooth.prl contains:
QMAKE_PRL_LIBS = $$[QT_INSTALL_LIBS]/libQt5Core.a -framework MobileCoreServices -lm -framework UIKit -framework CoreFoundation -framework Foundation -lz $$[QT_INSTALL_LIBS]/libqtpcre2.a -framework Foundation -framework CoreBluetooth
So actually all information about what to link should be somewhere inside cmake?
CMake support greatly improve since couple of version. When i wrote this script there were almost no CMake support in Qt for Ios. I think it can be a good idea to support build against qt 5.12 at while it's still LTS.
If build this project https://github.com/OlivierLDff/QQuickStaticHelloWorld without any bluetooth dependencies but the resulted binary depend on
CoreBluetooth.framework
:The problem is that if upload such application to Apple Store, then Apple ask to explain why you need bluetooth. I see only one user of
CoreBluetooth.framework
in Qt installation:and clearly QQuickStaticHelloWorld don't depend on
Qt5Bluetooth
but for some reason it pulls it's dependencies.I build project in such way: