mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Avoid link error when cargo found Qt but CMake didn't
When using cmake to configure the C++ build and Qt is found, and then build with `SIXTYFPS_NO_QT=0 cmake --build ..`, the C++ library is built without Qt support but qt_viewer is built. Linkage then fails when it tries to access the API in libsixtyfps_cpp.so that provides the QWidget, as that symbol is not present. So with newer CMake we use find_package to provide positive information to the cargo build about where Qt is, and consequently this patch provides negative information to disable Qt support if CMake could not find Qt -- or it was deliberately disabled for example using `-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=1`. cc #232
This commit is contained in:
parent
7f117829f2
commit
5f6ed2488e
1 changed files with 7 additions and 0 deletions
|
@ -31,6 +31,13 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.19.0)
|
||||||
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
QMAKE=$<TARGET_PROPERTY:Qt5::qmake,LOCATION>
|
QMAKE=$<TARGET_PROPERTY:Qt5::qmake,LOCATION>
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
set_property(
|
||||||
|
TARGET sixtyfps-cpp
|
||||||
|
APPEND
|
||||||
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
|
SIXTYFPS_NO_QT=1
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue