Files
swift-mirror/include/swift/Basic/Platform.h
David Farler 544ef4002d Merge tvOS and watchOS Support
- Add frontend and standard library build support for tvOS.
- Add frontend support for watchOS.

watchOS standard library builds are still disabled during SDK bring-up.

To build for TVOS, specify --tvos to build-script.
To build for watchOS, specify --watchos to build-script (not yet supported).

This patch does not include turning on full tests for TVOS or watchOS, and
will be included in a follow-up patch.

Swift SVN r26278
2015-03-18 21:35:07 +00:00

46 lines
1.5 KiB
C++

//===--- Platform.h - Helpers related to target platforms -------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_PLATFORM_H
#define SWIFT_BASIC_PLATFORM_H
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
namespace llvm {
class Triple;
}
namespace swift {
/// Returns true if the given triple represents iOS running in a simulator.
bool tripleIsiOSSimulator(const llvm::Triple &triple);
/// Returns true if the given triple represents AppleTV running in a simulator.
bool tripleIsAppleTVSimulator(const llvm::Triple &triple);
/// Returns true if the given triple represents watchOS running in a simulator.
bool tripleIsWatchSimulator(const llvm::Triple &triple);
/// Returns the platform name for a given target triple.
///
/// For example, the iOS simulator has the name "iphonesimulator", while real
/// iOS uses "iphoneos". OS X is "macosx". (These names are intended to be
/// compatible with Xcode's SDKs.)
///
/// If the triple does not correspond to a known platform, the empty string is
/// returned.
StringRef getPlatformNameForTriple(const llvm::Triple &triple);
}
#endif // SWIFT_BASIC_PLATFORM_H