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

building into a shared library #662

Open
nextdayy opened this issue Aug 8, 2023 · 6 comments
Open

building into a shared library #662

nextdayy opened this issue Aug 8, 2023 · 6 comments

Comments

@nextdayy
Copy link

nextdayy commented Aug 8, 2023

hi, I recently tried to build nanovg as a shared library by changing the type to SharedLib in the file, and creating a nanovg_gl2.c file which included the files, but it would fail to build. (missing glFramebuffer stuff)

I am mainly unsure of what actually needs to be included if all I want is the nanovg API and the opengl 2 implementation (all the other stuff like GLFW I don't need)

I am attempting to compile it so I can use it with JNA to access the API, and any help would be appreciated (I have looked at the other similar issue by the way)
Many thanks.

@vinjn
Copy link
Collaborator

vinjn commented Aug 26, 2023

Are you using it on Android?

@nextdayy
Copy link
Author

no, just trying to build for JNA. we are specifically targeting Linux, MacOS, MacOS ARM, and Windows. I was trying to build on Linux.

@vinjn
Copy link
Collaborator

vinjn commented Aug 28, 2023

Ok - glFramebuffer stuff is not part of nanovg, it's covered by libraries like glew, did you built the library aginst glew?

@nextdayy
Copy link
Author

yeah, I'm not sure how I'd build against glew into JNA - firstly when I tried with it with glew, it wouldn't work as shared library, but also, I don't know how to do it with glew in the JNA (I guess I'd need to include glew as well?)

@vinjn
Copy link
Collaborator

vinjn commented Aug 28, 2023

Yes, you need to include glew

@dylanxyz
Copy link

dylanxyz commented Nov 1, 2023

You may look at the scripts i wrote in build_tarballs.jl, which builds nanovg as a shared library to be used from the julia language.

Additionally, i converted the premake file to a CMake one. You can see it here: CMakeLists.txt. There are also some patches for some headers missing, but this may vary depending on the platform you're building for.

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

3 participants