forked from sqlcipher/sqlcipher
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix iOS builds from command line #1
Closed
darrenclark
wants to merge
10
commits into
groue:master
from
darrenclark:fix-ios-builds-from-command-line
Closed
Fix iOS builds from command line #1
darrenclark
wants to merge
10
commits into
groue:master
from
darrenclark:fix-ios-builds-from-command-line
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a workaround for sqlcipher#162 But we need another fix, since SQLITE_ENABLE_UPDATE_DELETE_LIMIT should not be used when building from the amalgation, according to https://www.sqlite.org/compile.html#enable_update_delete_limit
Ues the same compilation options than the stock sqlite3 shipped with OS X 10.11 and iOS 9.3, as exposed through PRAGMA compile_options. See sqlcipher#163
This reverts commit 4f5bec0.
For whatever reason, it seems when building inside Xcode.app, the amalgamation target has environment variables set as if it is being built for macOS (even when building the iOS library), so the configure/make steps work fine. However, when building via the command line (ie: `xcodebuild -scheme sqlcipher -configuration Release -sdk iphoneos`), the amalgamation target was getting environment variables set as if it was building for iOS. This was causing the `configure` step to fail, because it thought the compiler was broken (macOS couldn't run binaries that were being built for iOS). This commit fixes the issue by always running configure as if we were building for macOS. (The sqlcipher target will still build libraries for the correct platform, as it did before)
- Remove the SQLCipher OSX/iOS/watchOS/tvOS schemes - Add a 'sqlcipher' scheme that supports all 4 of the plaforms - Update SUPPORTED_PLATFORMS to include all 4 platforms and their simulator counterparts, add armv7k (Watch) to VALID_ARCHS
Many thanks @darrenclark for your much appreciated Xcode skills! I've cherry picked your commits on top of sqlcipher v3.4.1 and pushed the result on master branch. |
groue
added a commit
to groue/GRDB.swift
that referenced
this pull request
Oct 11, 2017
You're welcome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes include:
1. Fix building the iOS library from the command line
(Basically a copy/paste of the fixes made here: swiftlyfalling/SQLiteLib#24)
When building via the
xcodebuild
, ie:the
amalgamation
target would fail when running theconfigure
script with an error like:It turns out it was getting tripped up because it was running the configure script as if it was trying to build for iOS, causing the
configure: error: cannot run C compiled programs.
error.It seems Xcode &
xcodebuild
differ in behaviour here:Xcode runs the run script build phase as if it was compiling for macOS, even when building the library for iOS
xcodebuild
runs the run script build phase as if it was compiling for whatever platform is specified via the-sdk
option. This causes all sorts of issues for non-macOS because theMakefile
builds & runs some command line utilities as part of the build process:This PR/commit ensures the configure script & make are always run as if we are building for macOS. (The
sqlcipher
target will still build for the selected platform).Here's the new run script build phase (as the diff is pretty unreadable):
2. Misc. project file cleanup
Some project files changes inspired by the project file in https://github.com/swiftlyfalling/SQLiteLib
sqlcipher
target for all platforms)SUPPORTED_PLATFORMS
to include all 4 platforms and their simulator counterparts, addarmv7k
(Watch) toVALID_ARCHS