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

build: create build macros #1045

Open
2 tasks
asraa opened this issue Oct 13, 2024 · 3 comments
Open
2 tasks

build: create build macros #1045

asraa opened this issue Oct 13, 2024 · 3 comments

Comments

@asraa
Copy link
Collaborator

asraa commented Oct 13, 2024

for cmake:

  • add_heir_transforms

for bazel:

  • investigate whether it's worth creating bazel macros to avoid some boilerplate around dialect / pass generation
@j2kun
Copy link
Collaborator

j2kun commented Oct 14, 2024

@AlexanderViand-Intel maybe you can explain what part of the boilerplate seems confusing? Is it the invocation of gentbl_cc_library? as in https://github.com/google/heir/blob/90796977be9b7da90f5dd8bd8a9fbfc75039cc33/lib/Dialect/Secret/Transforms/BUILD#L156C1-L156C18

@AlexanderViand-Intel
Copy link
Collaborator

Less "confusing", just somewhat verbose compared to add_heir_dialect(DialectName) ;)

The "convenience factor" that I like is that the CMake macro automatically generates inc files for ops, types, attributes, enums, etc based on whether the corresponding *.td file exits (plus, at least for passes, a few additional rules based on observed use patterns). So there's less changing of build files when you add/remove *.td files.

@j2kun
Copy link
Collaborator

j2kun commented Oct 14, 2024

I think I can do that. Only caveat I can see rn is that the dependencies will have to be specified outside the macro.

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