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

Fixed cmake build and target arguments #573

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

UebelAndre
Copy link
Collaborator

Targets can now be properly passed to the CMake build command and arguments are now appropriately the last thing to be passed to provide the most flexibility.

Comment on lines 14 to 16
# Pass arguments to the underlying build tool
"--",
"-j 1",
Copy link
Member

Choose a reason for hiding this comment

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

Are we better demonstrating --parallel here: https://stackoverflow.com/a/50883540/6857772 or https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html? Feels like a more portable way of doing this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My goal here wasn't strictly to demonstrate parallel builds. I just wanted to show how to pass arguments to the build tool
https://cmake.org/cmake/help/latest/command/build_command.html
note the -- -i

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've updated the example to hopefully make this clearer

@@ -48,6 +48,7 @@ tasks:
- "-//cmake_defines/..."
- "-//cmake_hello_world_lib/..."
- "-//cmake_with_data/..."
- "-//cmake_with_target/..."
Copy link
Member

Choose a reason for hiding this comment

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

If we defaulted to ninja then these would work on RBE...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd rather spend next release getting RBE to work (build the make binary)

@jsharpe jsharpe enabled auto-merge (squash) March 18, 2021 15:27
@UebelAndre UebelAndre requested a review from jsharpe March 18, 2021 15:27
@jsharpe jsharpe merged commit d425656 into bazel-contrib:main Mar 18, 2021
@UebelAndre UebelAndre deleted the cmake branch March 18, 2021 15:56
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.

2 participants