aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/extralibs.py
blob: 80f0a70cdc1353cb040b2ce0a4ca0359b915c5be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def onpy_extralibs(unit, *args):
    """
    @usage: EXTRALIBS(liblist)
    Add external dynamic libraries during program linkage stage" }
    """

    libs = unit.get("OBJADDE_LIB_GLOBAL")
    changed = False
    if not libs:
        libs = ''
    for lib in args:
        if not lib.startswith('-'):
            lib = '-l' + lib
        if lib not in libs:
            libs = libs + ' ' + lib
            changed = True
    if changed:
        unit.set(["OBJADDE_LIB_GLOBAL", libs])