Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure when Qt is built with opengles #829

Closed
krop opened this issue Sep 5, 2023 · 5 comments
Closed

Build failure when Qt is built with opengles #829

krop opened this issue Sep 5, 2023 · 5 comments

Comments

@krop
Copy link
Contributor

krop commented Sep 5, 2023

Seen with 3.0 on aarch64:

[  675s] FAILED: plugins/quickinspector/CMakeFiles/gammaray_quickinspector.dir/textureextension/qsgtexturegrabber.cpp.o 
[  675s] /usr/bin/c++ -DQT_CORE_LIB -DQT_DISABLE_DEPRECATED_BEFORE=0x050500 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_URL_CAST_FROM_STRING -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_STRICT_ITERATORS -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -Dgammaray_quickinspector_EXPORTS -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/build/plugins/quickinspector -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/plugins/quickinspector -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/build/plugins/quickinspector/gammaray_quickinspector_autogen/include -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0 -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/3rdparty -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/build -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/build/common -I/home/abuild/rpmbuild/BUILD/gammaray-3.0.0/build/core -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib64/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtGui -isystem /usr/include/qt6/QtQuick -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/qt6/QtQmlModels -isystem /usr/include/qt6/QtOpenGL -isystem /usr/include/qt6/QtQuick/6.5.2 -isystem /usr/include/qt6/QtQuick/6.5.2/QtQuick -isystem /usr/include/qt6/QtCore/6.5.2 -isystem /usr/include/qt6/QtCore/6.5.2/QtCore -isystem /usr/include/qt6/QtGui/6.5.2 -isystem /usr/include/qt6/QtGui/6.5.2/QtGui -isystem /usr/include/libxkbcommon -isystem /usr/include/qt6/QtQmlModels/6.5.2 -isystem /usr/include/qt6/QtQmlModels/6.5.2/QtQmlModels -isystem /usr/include/qt6/QtQml/6.5.2 -isystem /usr/include/qt6/QtQml/6.5.2/QtQml -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -Wunused-but-set-variable -Wlogical-op -Wsizeof-pointer-memaccess -Wreorder -Wformat-security -Wsuggest-override -Wall -Wextra -pedantic -Woverloaded-virtual -Winit-self -Wmissing-include-dirs -Wunused -Wundef -Wpointer-arith -Wmissing-noreturn -Werror=return-type -Wswitch -std=gnu++0x -fno-operator-names -Wzero-as-null-pointer-constant -O2 -g -DNDEBUG -std=gnu++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT plugins/quickinspector/CMakeFiles/gammaray_quickinspector.dir/textureextension/qsgtexturegrabber.cpp.o -MF plugins/quickinspector/CMakeFiles/gammaray_quickinspector.dir/textureextension/qsgtexturegrabber.cpp.o.d -o plugins/quickinspector/CMakeFiles/gammaray_quickinspector.dir/textureextension/qsgtexturegrabber.cpp.o -c /home/abuild/rpmbuild/BUILD/gammaray-3.0.0/plugins/quickinspector/textureextension/qsgtexturegrabber.cpp
[  675s] /home/abuild/rpmbuild/BUILD/gammaray-3.0.0/plugins/quickinspector/textureextension/qsgtexturegrabber.cpp:20:10: fatal error: QOpenGLFunctions_2_0: No such file or directory
[  675s]    20 | #include <QOpenGLFunctions_2_0>
[  675s]       |          ^~~~~~~~~~~~~~~~~~~~~~
[  675s] compilation terminated.
@krop
Copy link
Contributor Author

krop commented Sep 5, 2023

GLES builds have QOpenGLFunctions_ES2 / qopenglfunctions_es2.h and QT_NO_OPENGL is false.

Same reason as https://codereview.qt-project.org/gitweb?p=pyside%2Fpyside-setup.git;a=commit;h=d790345

@winterz
Copy link
Member

winterz commented Sep 5, 2023

would this work?

#if !defined(QT_NO_OPENGL) && !QT_CONFIG(opengles2)
#include <QOpenGLFunctions_2_0>
#endif

@krop
Copy link
Contributor Author

krop commented Sep 5, 2023

Testing. !defined(QT_NO_OPENGL) is not needed, the CMakeLists.txt file appends this file only when QT_NO_OPENGL is f alse

@krop
Copy link
Contributor Author

krop commented Sep 5, 2023

The build is fixed with the include guard

@winterz
Copy link
Member

winterz commented Sep 5, 2023

Testing. !defined(QT_NO_OPENGL) is not needed, the CMakeLists.txt file appends this file only when QT_NO_OPENGL is f alse

true. I'll probably keep the !defined(QT_NO_OPENGL) simply because that's used in other places in the same source file

@winterz winterz closed this as completed in 56cbec0 Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants