question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for disabling optional dependencies even if they can be found.

See original GitHub issue

more precise description in: https://github.com/mesonbuild/meson/issues/8224#issuecomment-763809674


continuation of #2452 Seems like this is not solved. #2411 was closed and not merged. Even with #3376 it actually requires meson.build to do the correct thing (which it often does not or the build script is a mix of correct and wrong).

You probably want to have a look at CMAKE_DISABLE_FIND_PACKAGE_<PackageName> from CMake to actually learn from it. On a different but related issue: I also saw people suggesting/looking for something like <PackageName>_DIR from CMake

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
mensindacommented, Jan 20, 2021

So, if I understand correctly, the main issue here is that some projects do stuff like:

someDep = dependency('someDep', required: false)

if someDep.found()
  # Do stuff you want to explicitly disable even if someDep is found
  # and the user did not provide another toggle for this condition
endif

If this is the case, I would suggest trying to find a solution for this particular use case, instead of arguing why/if exactly, CMAKE_DISABLE_FIND_PACKAGE is bad. Also, we could argue if we want to actually do something about this / if we actually recognize this as a problem. Debating some CMake design decisions won’t be to anyone’s benefit.

1reaction
eli-schwartzcommented, Jan 20, 2021

I have actually, for real, told people “cmake sucks, don’t use cmake. Cmake lets you do nonsense like DISABLE_FIND_PACKAGE instead of proper options. Use meson instead.”

It would feel pretty weird to me if meson then went around and added support for this misfeature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven – Optional Dependencies and Dependency Exclusions
This section discusses optional dependencies and dependency exclusions. This will help users to understand what they are and when and how to use...
Read more >
Optional dependencies don't work (2019) - Michael Stapelberg
I'm not saying optional dependencies should never be used. In fact, for bootstrapping, disabling dependencies can save a lot of work and can ......
Read more >
Disable optional dependency installation in ocaml opam
If the optional dependency changes the core behavior of your package, i.e., if it is not an extension, but a modification, then it...
Read more >
Optional dependency in library generates `undefined ...
Public functionality (that would be exposed in docs) should always work, even if the optional dependencies aren't there, so you shouldn't run ...
Read more >
The Java Library Plugin - Gradle User Manual
If your build consumes a published module with POM metadata, the Java and ... This section will help you identify API and Implementation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found