CMake: Fix usage requirements for static builds of Qt on macOS
When scanning the prl files to set up usage requirements for the Qt libraries we omitted "-framework Foo" flags. Those were passed as linker flags, but not as interface libraries. Consequently, the frameworks that are used by Qt libraries were missing on the link line when building against a statically built Qt. Fix this issue by scanning the dependencies for "-framework Foo" just like we do with "-lfoo" flags. Fixes: QTBUG-80855 Change-Id: Ie7804304141c86207d143a6e1005e78bdc099113 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Kyle Edwards <kyle.edwards@kitware.com>
This commit is contained in:
parent
6b835d5e51
commit
cca279338c
@ -72,10 +72,19 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
|
||||
string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends \"${_prl_strings}\")
|
||||
string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\")
|
||||
set(_search_paths)
|
||||
set(_framework_flag)
|
||||
string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\")
|
||||
foreach(_flag ${_static_depends})
|
||||
string(REPLACE \"\\\"\" \"\" _flag ${_flag})
|
||||
if(_flag MATCHES \"^-l(.*)$\")
|
||||
if(_flag MATCHES \"^-framework$\")
|
||||
# Handle the next flag as framework name
|
||||
set(_framework_flag 1)
|
||||
elseif(_framework_flag OR _flag MATCHES \"^-l(.*)$\")
|
||||
if(_framework_flag)
|
||||
# Handle Darwin framework bundles passed as -framework Foo
|
||||
unset(_framework_flag)
|
||||
set(_lib ${_flag})
|
||||
else()
|
||||
# Handle normal libraries passed as -lfoo
|
||||
set(_lib \"${CMAKE_MATCH_1}\")
|
||||
foreach(_standard_library ${_standard_libraries})
|
||||
@ -84,6 +93,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
if (_lib_is_default_linked)
|
||||
unset(_lib_is_default_linked)
|
||||
elseif(_lib MATCHES \"^pthread$\")
|
||||
|
Loading…
x
Reference in New Issue
Block a user