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 against system deps, Python test fixes #250

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

pabs3
Copy link
Contributor

@pabs3 pabs3 commented Aug 27, 2021

Add mode to build against system versions of dependencies.

Use right Python interpreter, port Python tests to Python 2.

@axxel
Copy link
Collaborator

axxel commented Aug 27, 2021

Thanks a lot for the work. I have 2 questions, though:

  1. Python 2, seriously?!?
  2. Would it not be preferable to use the system provided fmt/pybind/googletest packages by default if available and fall back to the FetchContent ones if not? Thereby eliminating the need for the extra BUILD_SYSTEM_DEPS option.

@pabs3
Copy link
Contributor Author

pabs3 commented Aug 27, 2021 via email

@pabs3
Copy link
Contributor Author

pabs3 commented Aug 27, 2021 via email

@axxel
Copy link
Collaborator

axxel commented Aug 27, 2021

ad Python 2: I prefer not to add 'cruft' just to supports deprecated software. (If it was for me, we'd be at c++20 already ;))

ad FetchContent: Yes, the auto/no/yes approach is obviously the most flexible. Default should be auto.

ad stb: There is a 2 line change that allows to use the upstream version but that comes at a considerable runtime cost for the blackbox tests (30% slower). There should also be a bit more elaborate change which should take care of that. I agree that treating stb exactly like the other 3 external dependencies would be preferable and cleaner. I'll look into the required changes and then either drop the local copy of stb myself or let you know about it ;).

Some Python interpreter distributions are versioned, so
the right version has to be used or the test will fail.
@pabs3
Copy link
Contributor Author

pabs3 commented Aug 27, 2021 via email

@axxel
Copy link
Collaborator

axxel commented Aug 27, 2021

Something went wrong with the default value, it seems. Could you have a look at the build log failure? I'm off for the weekend now. Will come back to this on Monday. Thanks!

Make the default be to use system versions when available,
but allow always using them or never using them.

Add searching for and using system versions of fmt/googletest/pybind11,
which are currently pulled directly from git using FetchContent.

This will allow distributions that do not allow network access at build
time to depend on and build against these packages.

Fixes: zxing-cpp#248
@pabs3
Copy link
Contributor Author

pabs3 commented Aug 27, 2021 via email

@axxel axxel merged commit 8db14ee into zxing-cpp:master Aug 30, 2021
@pabs3 pabs3 deleted the build-fixes branch August 30, 2021 23:14
@pabs3
Copy link
Contributor Author

pabs3 commented Jan 31, 2022

@axxel did you get a chance to look into using an unpatched stb version?

axxel added a commit that referenced this pull request Feb 2, 2022
…tive

This removes the need to use a ZXing specific version of stb_image.h.
The provided alternative for the Blackbox tests is now almost as
fast as before.

See also #250.
@axxel
Copy link
Collaborator

axxel commented Feb 2, 2022

I totally forgot about it...

If you feel like it, please feel free to look into the possibility to treat stb_image similar to the other external dependencies. I.e. fetch it directly from github in case it is not provided by the system libraries. Then we can completely remove the copy from the repo, I believe.

@pabs3
Copy link
Contributor Author

pabs3 commented Feb 3, 2022 via email

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