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

importC & zig cc #50

Closed
kassane opened this issue Jan 17, 2025 · 1 comment · Fixed by #51
Closed

importC & zig cc #50

kassane opened this issue Jan 17, 2025 · 1 comment · Fixed by #51
Labels
bug Something isn't working question Further information is requested

Comments

@kassane
Copy link
Owner

kassane commented Jan 17, 2025

The primary version [from zigcc-wrapper] available in sokol-d provides only native targeting, unlike the abs implementation (which supports multiple targets1).

Previous, on windows (wasm32 target) was called msvc (it's wrong!!): https://github.com/kassane/sokol-d/actions/runs/12775927090/job/35613419304#step:10:157

According to #49, it is shown that the importC used in the dcimgui module allows ldc2 to process C code (call the C compiler) by using mixed accesses. However, the wasm32 target can't give emcc direct access to ldc2. So cc is not available2 for processing C files.
Here zig cc is starred in importC, making it easily accessible regardless of platform!

Footnotes

  1. https://github.com/kassane/anotherBuildStep/blob/0457a46f52c6151b754437c5b5e0b01856d34fa4/toolchains/zigcc.zig#L41-L153

  2. https://github.com/kassane/sokol-d/actions/runs/12831642586/job/35782559123?pr=49#step:10:33

@kassane kassane added bug Something isn't working question Further information is requested labels Jan 17, 2025
@kassane
Copy link
Owner Author

kassane commented Jan 17, 2025

For the Windows case (MSVC), ldc2 prefers clang-cl (if available) by default, -gcc=$CC is used with importC.
However, if use D files this will be ignored. Only -linker=$LD can be called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant