Skip to content

Bazel to CMake: Refactor _convert_target() - #622

Closed
marbre wants to merge 4 commits into
iree-org:masterfrom
iml130:bazel-to-cmake-2
Closed

marbre wants to merge 4 commits into
iree-org:masterfrom
iml130:bazel-to-cmake-2

Conversation

@marbre

@marbre marbre commented Jan 30, 2020

Copy link
Copy Markdown
Member
  • Don't add full package name to local deps
  • Handles local deps and IREE deps including the full package name within the same conversion block
  • Drop local deps ending on _gen or Gen

Comment thread build_tools/scripts/bazel_to_cmake.py Outdated
# LLVMTableGen still need to be included.
return ""
elif not target.startswith("//iree"):
if target.startswith(":") and target.endswith(("_gen","Gen")):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for providing the references. Pylint is not really happy with the current scripts anyway ;)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have my editor set up to run pylint/clang-format/etc. on file save so I usually don't have to care about indentation, spacing, trailing spaces/newlines, etc. There could be some differences between the formatting that the Google configuration of those tools uses and the global defaults though.

This case might even be handled by our import automation, but we aim to keep the merged code as close to the code in the PR as possible.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, I agree that the code should keep close. I'll will be more careful next time.

Comment thread build_tools/scripts/bazel_to_cmake.py Outdated
# marked as ALWAYSLINK.
# This drops deps in the local namespace ending with '_gen' and 'Gen'
target = ""
elif not target.startswith(("//iree",":")):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Both done.

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