Fix darwin SDK detection logic (IOT-1862)
authorMats Wichmann <mats@linux.com>
Sat, 4 Mar 2017 15:06:34 +0000 (08:06 -0700)
committerMats Wichmann <mats@linux.com>
Fri, 1 Sep 2017 20:57:21 +0000 (20:57 +0000)
commitb3d0417313bf215d27b74af2c898e309ffa9323d
treec5f3602664a8d43c7357a5904d12a7a83524f659
parentd16ff12746473cabcc9d020c101c3da002e536eb
Fix darwin SDK detection logic (IOT-1862)

Also a small refactor in the ios sconscript

The logic parses text from querying xcodebuild to find the latest sdk
version supported by the host, but it seems the content of this text has
changed over time, so we have to recognize a couple of tags for the Mac.

The original version had a flaw: the script can be called with
SYS_VERSION set to indicate a minimum version, but then it checks if an
SDK path with that version is installed, which might not be the case.
e.g.: SYS_VERSION=10.10, but the only installed SDK is for 10.12.
Calling with "-mmacosx-version-min=10.10" is fine, but checking if
.../Platforms/MacOSX.platform/Developer/SDKS/MacOSX/x86_64/10.10 exists
as a condition is not.  This has been adjusted by checking if a requested
version exists in the list of detected versions, and bumping the requested
version up to a found one, unless the found ones are actually lowere
than the requested.  It still seems awfully convoluted, but at least
works now on a 10.12 system without breaking the build in use for
IoTivity Jenkins.

Change-Id: I0e19893de52393789d23dcecc8d167d2236d4674
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21475
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
build_common/darwin/SConscript
build_common/ios/SConscript