summaryrefslogtreecommitdiff
path: root/gyp/link.py
blob: cab61aa9e63ca0da7df12c9b875d1e50aea7b37d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python

import sys
from merge_static_libs import MergeLibs

args = sys.argv[1:]

out_lib = ''
in_libs = []
flags = []

i = 0
l = len(args)
while i < l:
    arg = args[i]

    if arg[0:2] == '-l':
        flags.append(arg)
    elif arg == '-arch':
        i += 1
    elif arg == '-framework':
        i += 1
        flags.append(arg + ' ' + args[i])
    elif arg == '-o':
        i += 1
        out_lib = args[i]
    elif arg[0] != '-':
        in_libs.append(arg)
    else:
        print 'Ignored linker directive: ' + arg

    i += 1

MergeLibs(in_libs, out_lib)