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>