summaryrefslogtreecommitdiffstats
path: root/build/plugins/linker_script.py
blob: 37d7f66e21db5ab06b168c504a099fe375944c17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from ymake import macro, Unit


@macro
def LINKER_SCRIPT(unit: Unit, *args: tuple[str, ...]):
    """
    @usage: LINKER_SCRIPT(Files...)

    Specify files to be used as a linker script
    """
    for arg in args:
        if not arg.endswith(".ld") and not arg.endswith(".ld.in"):
            unit.message(['error', "Invalid linker script extension: {}".format(arg)])
            return

    unit.onglobal_srcs(list(args))