OmixVisualization / qtjambi

QtJambi is a wrapper for using Qt in Java.
http://www.qtjambi.io
Other
365 stars 43 forks source link

QtJambi build from scratch on windows has missing opengl classes #185

Closed wolfseifert closed 10 months ago

wolfseifert commented 10 months ago

Describe the bug When building QtJambi from scratch on windows using MSVC the resulting qtjambi-opengl-6.6.1.jar has missing opengl classes QOpenGLFunctions_1_0 to QOpenGLFunctions_4_5, only QOpenGLFunctions_ES2 exists. They are not even generated by the generator.

To Reproduce

% ant generate

Have a look at qtjambi/6.6.1/build/generator/cpp/QtJambiOpenGL and qtjambi/6.6.1/build/generator/java/qtjambi.opengl/io/qt/opengl and you see, that only QOpenGLFunctions_ES2 is there.

Expected behavior qtjambi-opengl-6.6.1.jar should be the same, whether produced on linux, windows or macos.

System (please complete the following information):

omix commented 10 months ago

This issue is related to QTBUG-110052.

You need Qt installed with sources. Then QtJambi build system takes the missing headers from there. They should be copied to 6.6.1/build/generator/missing-headers.

omix commented 10 months ago

Which branch did you use? v6.6.1 or master?

wolfseifert commented 10 months ago

master from 19.12.2023. Should I upgrade?

wolfseifert commented 10 months ago

I have Qt installed with sources.

But my qtjambi/6.6.1/build/generator/missing-headers/QtOpenGL contains only qopenglfunctions_es2.h (like on linux).

omix commented 10 months ago

I can confirm this behavior. Classes for QOpenGLFunctions_X_Y are not generated. This also applies to Qt 6.5.

wolfseifert commented 10 months ago

What makes the QOpenGLFunctions_X_Y header files in qt/6.6.1/msvc2019_64/include/QtOpenGL special is this line:

#if !defined(QT_NO_OPENGL) && !QT_CONFIG(opengles2)

The others do not have this second part in bold.

So I removed it from one of the header files and - voilá - it was generated!

Now we just need a way to make QT_CONFIG(opengles2) false, maybe by -DQT_FEATURE_opengles2=-1 at the right place.

omix commented 10 months ago

QtJambi Generator resolves all QT_CONFIG(feature) macros to true to make sure the Java API contains all possible methods independent from Qt's build configuration.

For opengles2 there was a workaround to accept QOpenGLFunctions_X_Y classes. I don't know why this approach does no longer work. Nevertheless, I replaced the solution by another one. Try to build with latest commit from master branch.

wolfseifert commented 10 months ago

You committed generator log files into the repository!

Please undo this first, then I will pull and test.

omix commented 10 months ago

Oh my goodness. I wasn't aware.

omix commented 10 months ago

I've undone this. Please try to build Qt.

wolfseifert commented 10 months ago

% ant generate works and all classes are generated. After doing a (successful) full build I will close this issue.

wolfseifert commented 10 months ago

The build on windows was successful and a meld-directory-diff of qtjambi/6.6.1/build/generator with its linux counterpart showed no significant difference. Therefore I am closing this issue.