[swift-evolution] [Draft] Adding a Build Configuration Import Test
clattner at apple.com
Wed Mar 23 11:52:11 CDT 2016
> On Mar 22, 2016, at 3:14 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> Expanding the build configuration suite to test for the ability to import certain modules was first introduced <http://article.gmane.org/gmane.comp.lang.swift.evolution/7516/match=darwin> on the Swift-Evolution list by Kevin Ballard. Although his initial idea (checking for Darwin to differentiate Apple targets from non-Apple targets) proved problematic, developers warmly greeted the notion of an import-based configuration test. Dmitri Gribenko wrote, "There's a direction that we want to move to a unified name for the libc module for all platform, so 'can import Darwin' might not be a viable long-term strategy." Testing for imports offers advantages that stand apart from this one use-case: to test for API availability before use.
Very interesting proposal. Note that this is directly analogous to the Clang extension “__has_include”. __has_include has been useful, and the C++ committee is discussing standardizing the functionality there.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution