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

Add sokol #10381

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Add sokol #10381

wants to merge 16 commits into from

Conversation

VarLad
Copy link
Contributor

@VarLad VarLad commented Jan 31, 2025

Currently only compiles on Linux.
Not sure whats the issue on Windows, on Apple I believe the lld-macos: error: undefined symbol: ___isPlatformVersionAtLeast issue can be fixed by linking to libclang_rt.osx but I'm not sure how to do that... any help would be appreciated!
Also, Apple and Windows are having the same issue of undefined reference to sokol_main, not sure what that means....

@giordano
Copy link
Member

on Apple I believe the lld-macos: error: undefined symbol: ___isPlatformVersionAtLeast issue can be fixed by linking to libclang_rt.osx but I'm not sure how to do that... any help would be appreciated!

When else fails, use the search functionality

S/Sokol/build_tarballs.jl Outdated Show resolved Hide resolved
@VarLad
Copy link
Contributor Author

VarLad commented Jan 31, 2025

When else fails, use the search functionality

That issue is solved, thanks! :)
All thats left is the undefined reference to sokol_main issue in both Windows and Apple...

S/Sokol/build_tarballs.jl Outdated Show resolved Hide resolved
S/Sokol/build_tarballs.jl Outdated Show resolved Hide resolved
VarLad and others added 2 commits February 1, 2025 23:23
@VarLad
Copy link
Contributor Author

VarLad commented Feb 3, 2025

@giordano Any idea on the issue that is occurring for Windows and Apple builds? Looks like its the same issue for both 🙃

@VarLad
Copy link
Contributor Author

VarLad commented Feb 6, 2025

All required builds pass, except rv64 since it lacks a dependency, which I disabled! Should be ready for review now.

@imciner2
Copy link
Member

imciner2 commented Feb 6, 2025

I'm confused by exactly what you are trying to package here. According to the upstream git repo (https://github.com/floooh/sokol), sokol is a header library, meaning it should just be packaging headers that the dependencies include. You seem to be adding a C file that has an empty main function and compiling a shared library - why is this needed? If this is truly just a header only library, then this library just needs to install the headers and have an AllPlatforms tag.

@VarLad
Copy link
Contributor Author

VarLad commented Feb 6, 2025

@imciner2 I share similar concerns so I looked up previous instances of something similar

So I thought building it as a library and wrapping it with Clang.jl is the best way forward.

has an empty main function

Windows and Apple demand this :)

@giordano
Copy link
Member

giordano commented Feb 6, 2025

Maybe the question is: what do you want to do exactly with this?

@VarLad
Copy link
Contributor Author

VarLad commented Feb 6, 2025

Maybe the question is: what do you want to do exactly with this?

Generate bindings with Clang.jl and use its functions

@VarLad
Copy link
Contributor Author

VarLad commented Feb 6, 2025

@giordano Given that I want to use the functions from this library in Julia, if not this, what is the best way to do this in your opinion.
The first example I've posted is doing exactly this I believe.
The second one I suspect is doing something similar too, and those are the official bindings from the developer.

Although, I looked for something similar in JuliaBinaryWrappers and couldn't find anything similar to my case. There's stb but its simply packaged as headers and I don't see a julia package which uses them or expose them to someone using it to write a Julia library.

@imciner2
Copy link
Member

imciner2 commented Feb 6, 2025

Ok, if you want to actually use these functions in Julia, then you probably do need to compile this into a library. Usually we see header only libraries used as dependencies for other packages instead of from Julia itself.

As for the wrapper, it looks more complicated and confusing than it really needs to be. It references emscripten in the CMake, you don't need to give the headers to the target, and also the main function isn't needed (libraries don't have main functions).

@VarLad
Copy link
Contributor Author

VarLad commented Feb 7, 2025

@imciner2 Thanks for the comment! I made some changes accordingly :)

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

Successfully merging this pull request may close these issues.

3 participants