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

Fix iOS SDK version detection for Xcode 7 #502

Merged
merged 2 commits into from
Aug 10, 2015

Conversation

phatblat
Copy link
Member

@phatblat phatblat commented Aug 9, 2015

Without this change, update_libgit2_ios reports building for iphonesimulator2.0 when using Xcode 7

Building for x86_64 i386 armv7 armv7s arm64
Building libgit2 for iphonesimulator2.0 x86_64
Please stand by...
/Users/phatblat/dev/ios/Octopad/Carthage/Checkouts/objective-git/External/libgit2-ios/iphonesimulator2.0-x86_64.sdk/build-libgit2.log

And the build randomly fails (Xcode GUI fails on first architecture, command line builds get through those but fail on the first ARM architecture).

-- The C compiler identification is AppleClang 7.0.0.7000065
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
...
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
CMake Error at /usr/local/Cellar/cmake/3.3.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.3.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.3.0/share/cmake/Modules/FindThreads.cmake:204 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:458 (FIND_PACKAGE)

👌 This change is compatible with Xcode 6.3 and 6.4.

DEVELOPER_DIR=/Applications/Xcode7-beta5.app xcodebuild -version -sdk | grep -A 1 '^iPhone' | tail -n 1 | awk '{ print $2 }'
9.0

DEVELOPER_DIR=/Applications/Xcode6.4.app xcodebuild -version -sdk | grep -A 1 '^iPhone' | tail -n 1 | awk '{ print $2 }'
8.4 

DEVELOPER_DIR=/Applications/Xcode6.3.2.app xcodebuild -version -sdk | grep -A 1 '^iPhone' | tail -n 1 | awk '{ print $2 }'
8.3

The new WatchOS2.0.sdk and WatchSimulator2.0.sdk broke the assumption that the iPhone SDK was last in the list.

@joshaber
Copy link
Member

Nice work!

joshaber added a commit that referenced this pull request Aug 10, 2015
Fix iOS SDK version detection for Xcode 7
@joshaber joshaber merged commit 24da1ea into libgit2:master Aug 10, 2015
@phatblat phatblat deleted the ben/xcode7/build branch August 11, 2015 02:42
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