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 Cimport support #589

Merged
merged 5 commits into from
Aug 21, 2022
Merged

Conversation

Techatrix
Copy link
Member

@Techatrix Techatrix commented Aug 20, 2022

Runs zig translate-c on cImport nodes if possible. Results are globally cached and only re-translated if necessary.
Without comptime evaluation only simple cImport are translatable. fixes #366 and fixes #313

NOTE Currently there is not Goto Definition support when hovering over the cImport node itself. You have to use one of its exported symbols.
NOTE this PR also renames build_runner_cache_path to global_cache_path because it is also used as zig translate-c's cache-dir

Examples taken from VS Code

Screenshot_20220819_000949
Screenshot_20220819_001056

@SuperAuguste
Copy link
Member

Hoooly moly this is impressive!

Copy link
Member

@SuperAuguste SuperAuguste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SuperAuguste SuperAuguste merged commit dcf4338 into zigtools:master Aug 21, 2022
@Techatrix Techatrix deleted the cimport-support branch August 21, 2022 13:11
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.

Completions for output of @cImport Complete cImport symbols
2 participants