-
-
Notifications
You must be signed in to change notification settings - Fork 473
Conditionally include iOS-Wrapper project #415
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
Conversation
Thanks for your effort to contribute. Looks like you had (and fixed) the same issue as discussed in #375? As mentioned there, I'm happy to include an option to en/disable the framework setting if convinced that this is useful. You wrote that with this option "integrating another universal framework into the consuming project" is necessary. Can you elaborate? See also @parallaxe's comment. Either way, I'm not happy with your choice of words here: |
Thanks for the response! I did not see that this issue was already discussed in #375, but this is indeed addressing the same issue.
The main pain point for our integration is the necessity to run the build-release.sh script to generate the framework outside of CMake, this adds some extra work for integrating it into our dev and build pipeline which currently calls CMake directly to build the XCode project. Additionally, since the barcode reader component of our app is written directly in C++ without having platform specific implementations there's no need for us to include the framework as we can consume the ZXing C++ code directly as a pure C++ library and share the same code across all platforms. Even if we were to switch over to using the framework we would not opt to use the Apple specific wrapper code, so this just ends up including unneeded Objective-C code in our project. Where I think the framework has strong value is for integrating into iOS specific implementations given its nice integration with Swift/Objective-C.
I'm totally fine with renaming the definition, and those suggestions make sense to me. I would probably go with BUILD_APPLE_FRAMEWORK. |
Hey @axxel, just wanted to add my voice on this one. The main issue is that the iOS wrapper introduced language bindings (Swift/Objective-C) for use on iOS, and the changes to the core CMakeLists.txt now require you to build the language bindings in order to build the core code on for any Apple target. This means even if you have no need of the language bindings (Swift/Objective-C), you still have to build them to consume zxing-cpp in a project that builds for Apple platforms. As @Alex-MSFT said, in our case we are using zxing-cpp in platform agnostic code that is pure C++ with no Swift/Objective-C (or Java, or C#, or any other platform specific languages). In this case, there is no reason to build Swift/Objective-C language bindings, as it is just building extra platform specific code that won't be used. |
Thanks @Alex-MSFT and @ryantrem for the details but there is one thing I don't understand: I thought the question of whether or not a framework is build is independent of whether or not any ObjectiveC language bindings are build? In that case some other property of those specified in the |
@parallaxe: do you have anything to say about the proposed |
For just excluding the iOS wrappers I believe the main part that needs to be omitted is the inclusion of the wrappers module map I opted to make the flag cover the whole iOS block for a few reasons:
My personal opinion is that it is best to limit platform specific integration details where possible to keep integrating the project as similar as possible across platforms, and to avoid potential conflicts with platform specific configurations in consuming projects. |
Sounds fine for me. Our use case for integrating zxing into iOS-apps obviously does not cover all use-cases of zxing on Apple-platforms, and the reasonings in the discussions make sense. |
Thanks to everyone for the valuable input on this. |
Description
This PR adds a new compile definition check for conditionally including the iOS wrappers project, and adds it to build-release.sh.
Using the iOS wrappers added in #337 requires running an external build script, and integrating another universal framework into the consuming project. This adds some extra toolchain and integration complexity for projects, which do not make use of the iOS Swift/Objective-C wrappers.
I also had to disable bitcode to get build-release.sh to successfully build libzueci.
Validation
Ran build-release.sh locally and validated the demo app on device.
Built and ran a ZXing-cpp enabled iOS app which does not include the iOS wrappers and validated its behavior on both iOS and Android.