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

feat: rust bindgen and publish flow #1507

Merged
merged 1 commit into from
Jun 27, 2024
Merged

feat: rust bindgen and publish flow #1507

merged 1 commit into from
Jun 27, 2024

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Jun 24, 2024

Adds bindgen, which is a little bit complex due to build being inside gn. I moved a sizeof definition over just as a basic test but we should be able to migrate the entire struct definition and others in the future.

@devsnek devsnek force-pushed the x/bindgen branch 6 times, most recently from f6748f2 to da1f96f Compare June 25, 2024 03:24
@devsnek devsnek marked this pull request as ready for review June 25, 2024 03:43
@devsnek devsnek requested review from littledivy, bartlomieju and ry June 25, 2024 16:28
for define in target['defines']:
args.append(f'-D{define}')

print('\0'.join(args), end="")
Copy link
Member

Choose a reason for hiding this comment

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

The null delimiter makes it not very human readable. What about \n?

Copy link
Member Author

Choose a reason for hiding this comment

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

it turns out that using \n makes msvc very unhappy for some reason. \0 works so i think its ok to leave for now.

build.rs Show resolved Hide resolved
src/binding.rs Show resolved Hide resolved
build.rs Show resolved Hide resolved
build.rs Show resolved Hide resolved
build.rs Show resolved Hide resolved
@devsnek devsnek force-pushed the x/bindgen branch 2 times, most recently from f65963b to 58c2ba1 Compare June 27, 2024 01:08
@devsnek devsnek enabled auto-merge (squash) June 27, 2024 02:22
@devsnek devsnek merged commit 0b440db into main Jun 27, 2024
15 checks passed
@devsnek devsnek deleted the x/bindgen branch June 27, 2024 02:49
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