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

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

Closed
wolfseifert opened this issue Jan 12, 2024 · 12 comments
Closed

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

wolfseifert opened this issue Jan 12, 2024 · 12 comments
Assignees
Labels

Comments

@wolfseifert
Copy link

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):

  • OS: Windows
  • Java version: 21
  • QtJambi version: 6.6.1
  • Qt version: 6.6.1
@omix
Copy link
Contributor

omix commented Jan 12, 2024

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
Copy link
Contributor

omix commented Jan 12, 2024

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

@wolfseifert
Copy link
Author

master from 19.12.2023. Should I upgrade?

@wolfseifert
Copy link
Author

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
Copy link
Contributor

omix commented Jan 12, 2024

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

@wolfseifert
Copy link
Author

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 added a commit that referenced this issue Jan 12, 2024
@omix
Copy link
Contributor

omix commented Jan 12, 2024

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
Copy link
Author

You committed generator log files into the repository!

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

@omix
Copy link
Contributor

omix commented Jan 12, 2024

Oh my goodness. I wasn't aware.

omix added a commit that referenced this issue Jan 12, 2024
@omix
Copy link
Contributor

omix commented Jan 12, 2024

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

@wolfseifert
Copy link
Author

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

@wolfseifert
Copy link
Author

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.

omix added a commit that referenced this issue Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants