[swift-evolution] [Draft] Adding a Build Configuration Import Test

Chris Lattner 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:
> 
>  <https://gist.github.com/erica/b7f4226b8201945602f2#introduction>Introduction
> 
> 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.

http://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160323/c517ea14/attachment.html>


More information about the swift-evolution mailing list