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 cmake options for enabling and disabling builds #79

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

kotaweav
Copy link
Contributor

add cmake flags:

  • BUILD_EXAMPLES: whether to build the examples
  • BUILD_TESTS: whether to build the tests
  • BUILD_BENCHMARKS: whether to build the benchmarks

these are all off by default.

add cmake flags:
 - BUILD_EXAMPLES: whether to build the examples
 - BUILD_TESTS: whether to build the tests
 - BUILD_BENCHMARKS: whether to build the benchmarks

these are all off by default.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi there! Thank you for creating your first pull-request on the Graaf library :)

Copy link
Owner

@bobluppes bobluppes left a comment

Choose a reason for hiding this comment

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

Hi @kotaweav, thanks for the contribution! I think adding such options to our build system is a great addition.

I am however thinking whether we should create an "opt-out" system for these executables rather than an "opt-in". What do you think about introducing options such as SKIP_EXAMPLES, SKIP_TESTS, and SKIP_BENCHMARKS which are all set to OFF by default?

That way existing build systems would keep working without any change. It might also prevent confusion when a developer changes a class, successfully compiles the project locally, but the CI fails because some executable (which the developer did not explicitly opt-in for) cannot be compiled anymore.

@bobluppes
Copy link
Owner

Hi @kotaweav, do you still intend to work on this?

@kotaweav
Copy link
Contributor Author

kotaweav commented Sep 7, 2023 via email

@kotaweav
Copy link
Contributor Author

Hi @kotaweav, thanks for the contribution! I think adding such options to our build system is a great addition.

I am however thinking whether we should create an "opt-out" system for these executables rather than an "opt-in". What do you think about introducing options such as SKIP_EXAMPLES, SKIP_TESTS, and SKIP_BENCHMARKS which are all set to OFF by default?

That way existing build systems would keep working without any change. It might also prevent confusion when a developer changes a class, successfully compiles the project locally, but the CI fails because some executable (which the developer did not explicitly opt-in for) cannot be compiled anymore.

Hey! So, I'm back in town and wanted to revisit this. What are your thoughts instead of having BUILD_TESTS, etc. but ON by default? I think it would be less awkward to have it that way than to have them be double negatives? Would appreciate your thoughts! Thanks!

@bobluppes
Copy link
Owner

Hi @kotaweav, thanks for the contribution! I think adding such options to our build system is a great addition.
I am however thinking whether we should create an "opt-out" system for these executables rather than an "opt-in". What do you think about introducing options such as SKIP_EXAMPLES, SKIP_TESTS, and SKIP_BENCHMARKS which are all set to OFF by default?
That way existing build systems would keep working without any change. It might also prevent confusion when a developer changes a class, successfully compiles the project locally, but the CI fails because some executable (which the developer did not explicitly opt-in for) cannot be compiled anymore.

Hey! So, I'm back in town and wanted to revisit this. What are your thoughts instead of having BUILD_TESTS, etc. but ON by default? I think it would be less awkward to have it that way than to have them be double negatives? Would appreciate your thoughts! Thanks!

Hi, welcome back :)

My initial thought is that I would slightly prefer to express these flag as SKIP_* in order to signify it is an opt-out system. This would also be in line with how mvn handles this.

But I also do not have strong opinions, so I would be happy with both solutions. What do you think?

@kotaweav
Copy link
Contributor Author

I've certainly seen a lot of both XD OpenCV for example, goes the ENABLE_ route: https://github.com/opencv/opencv/blob/4.x/CMakeLists.txt#L519

But sure, I'll go ahead with SKIP_! Thanks for putting together such a cool library! 😄

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

see 12 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@bobluppes
Copy link
Owner

I've certainly seen a lot of both XD OpenCV for example, goes the ENABLE_ route: https://github.com/opencv/opencv/blob/4.x/CMakeLists.txt#L519

But sure, I'll go ahead with SKIP_! Thanks for putting together such a cool library! 😄

Haha, I am not sure if we will ever reach some standardization of such build configurations 😄 But thanks for addressing this!

Copy link
Owner

@bobluppes bobluppes left a comment

Choose a reason for hiding this comment

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

LGTM!
Congrats on the first contribution to Graaf 🎉

@bobluppes bobluppes added the tooling Any changes to the build process, dev tools, or CI steps label Sep 28, 2023
@bobluppes bobluppes merged commit 3491969 into bobluppes:main Sep 28, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Any changes to the build process, dev tools, or CI steps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants