def getCCSpec(compiler):
    """
    Helper function to return the key-value string to specify the compiler
    used for the make system.
    """

    lldbLib = os.environ["LLDB_LIB_DIR"] if "LLDB_LIB_DIR" in os.environ else None

    cc = compiler if compiler else None
    if not cc and "CC" in os.environ:
        cc = os.environ["CC"]

    swiftcc = swift.getSwiftCompiler()

    # Note the leading space character.
    if cc:
        if swiftcc:
            return (" CC=" + cc + " SWIFTCC=" + swiftcc + " SWIFTLIBS=" + swift.getSwiftLibraryPath() + " SWIFTSDKROOT=" + swift.getSwiftSDKRoot()) 
        else:
            return "CC=\"%s\"" % cc
    return ""
Beispiel #2
0
def getCCSpec(compiler):
    """
    Helper function to return the key-value string to specify the compiler
    used for the make system.
    """

    lldbLib = os.environ["LLDB_LIB_DIR"] if "LLDB_LIB_DIR" in os.environ else None

    cc = compiler if compiler else None
    if not cc and "CC" in os.environ:
        cc = os.environ["CC"]

    swiftcc = swift.getSwiftCompiler()

    # Note the leading space character.
    if cc:
        if swiftcc:
            return (" CC=" + cc + " SWIFTCC=" + swiftcc + " SWIFTLIBS=\"" + swift.getSwiftLibraryPath() +
                "\" SWIFTSDKROOT=\"" + swift.getSwiftSDKRoot() + "\"")
        else:
            return "CC=\"%s\"" % cc
    return ""
Beispiel #3
0
# 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
#
# ------------------------------------------------------------------------------

import argparse
import os
import sys
import commands
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'plugins'))

import swift

parser = argparse.ArgumentParser()
parser.add_argument('-l', action='store_true')
parser.add_argument('-s', action='store_true')

args = parser.parse_args()

if (args.l):
    print swift.getSwiftLibraryPath()
elif (args.s):
    print swift.getSwiftSDKRoot()
else:
    print swift.getSwiftCompiler()