-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
iOS build not working #953
Comments
Right now the way iOS is setup up to build, and I can modify this is that it ideally looks for your to place boost and openssl in the Build_iOS directory. I should perhaps expand this to also take a command line argument to point to it. If you look at Release/cmake/cpprest_find_openssl.cmake, you can see where this is done. Likewise boost also has a variation of this that tries and best find it. When building with iOS one typically has MacOS versions of boost and openssl. So it is helpful to override it. As an FYI, I never use configure.sh to build iOS. I already have pre-builts for these libraries since they are used in many different projects. |
If you're looking to build OpenSSL, you can use something like this. I haven't ran it recently, so it may need some mods with Xcode 10. https://gist.github.com/mobileben/dbe72732d9446a1a055f9d7fb453464c |
So these instructions are wrong? https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-iOS On macOS do a clean clone, follow the instructions for macOS and that works. If you then follow the iOS ones they fail. Using this as part of odatacpp-client. The configure script is fragile as it is depending on hardcoded paths to version dependent output which is naturally going to fail over time. |
MacOS should cleanly. iOS is a little harder based on the locations for the libraries are typically non-standard. I haven't actually built with the latest master in about a month, but it is on my list of things to do. I noticed that they made some mods from what I have (you can look at my fork). Earlier this year I did the PR to get iOS back and running. I think from my cursory glance, the newer stuff should work. Note that I essentially copy over my openssl and boost into Build_iOS. In particular, I don't like to use frameworks unless I really have to. So configure.sh builds a boost framework, I use a static lib version. Then to build, I simply do this:
Obviously you would use the min deployment you need. configure.sh helps mainly if you need to build boost and openssl. Note now you also have to build websocketpp, which was why I haven't yet build off of master. I just need to find the time to create a pre-built for my library repo. I'll try building near the end of the week. |
We build iOS in validation builds by running this script: https://github.com/Microsoft/cpprestsdk/blob/master/Build_iOS/configure.sh PRs very welcome to make it work in more places :) |
There are a few more broken things right now when building for iOS. Since the parameters set by the toolchain file are being reset, more or less all vital CXX-params are being reset, causing "defaulted" builds. Will fix a PR in the coming day. |
Do we have a list of "wants" that we want for this iOS build? When I originally updated the iOS build stuff, it wasn't clear people were interested in iOS because I got virtually no responses on my PR and any questions I asked. So more or less I just hammered in a solution that worked (admittedly for me). And one that somewhat mirrrored what was already being done. Which is where having openssl and boost in the Build_iOS being picked up came from. My main constraint, which I do not think is unusual as several large projects I have worked on do it, is that that certain common libs are pre-built and things already using C/C++ source are built as statics not frameworks. So at least for me the things to have are:
What else to others need? @leetal what are the params being reset? I will take a look at this too. At least from my fork, I do not believe this was happening (it is currently behind master, at least my last good build that I am currently running with which is 1 month old approx). |
Under Release/CMakeLists.txt around row 119 there is an if-case checking for "IOS". In that scope, the CMAKE_CXX_FLAGS are being reset without accepting any parameters from the toolchain (which works, i'm the maintainer of it ;)) |
But in regard to your previous question, we would also want possibilities to change what openssl library we want to use since we also build static libs and currently use BoringSSL which clashes with OpenSSL.. A better scope for this issue would indeed be needed. |
@leetal interesting, I've never used BoringSSL. Are you trying to use BoringSSL with cpprestsdk? Or rather are you trying to use BoringSSL for the app itself and using OpenSSL with cpprestsdk? I've actually had to mix 2 versions of openssl before within the same app. So not sure has the same type of conflicting. |
@mobileben We're currently using it with CppRestSDK and have gotten it to work instead of OpenSSL. The biggest problem we had was actually Boost ASIO, that did not fully support BoringSSL. |
@leetal ahh, got it. So you're not trying to have both exist concurrently. Aside from the asio issues, is your method just placing the boringssl (renamed) in the openssl directory in Build_iOS? |
With Xcode 10.1 build fails with 'Could not find OpenSSL for iPhone'
Build_iOS/configure.sh is looking into specific iOS version folders which may not be there (i.e. 10.1 has 12.1 sdk). Suggested changes
Builds and maintains the openssl/* directory structure
The text was updated successfully, but these errors were encountered: