Tweaked console output when building
This commit is contained in:
		
							parent
							
								
									ec77c87515
								
							
						
					
					
						commit
						9164c02a3e
					
				
					 1 changed files with 33 additions and 4 deletions
				
			
		| 
						 | 
					@ -6,7 +6,7 @@ from pathlib import Path
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
from typing import Callable, Literal, TextIO, Union
 | 
					from typing import Callable, Literal, TextIO, Union
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from . import shell, rules, model, ninja, const, cli
 | 
					from . import shell, rules, model, ninja, const, cli, vt100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_logger = logging.getLogger(__name__)
 | 
					_logger = logging.getLogger(__name__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -157,7 +157,16 @@ def compile(
 | 
				
			||||||
        rel = Path(src).relative_to(scope.component.dirname())
 | 
					        rel = Path(src).relative_to(scope.component.dirname())
 | 
				
			||||||
        dest = buildpath(scope, path="__obj__") / rel.with_suffix(rel.suffix + ".o")
 | 
					        dest = buildpath(scope, path="__obj__") / rel.with_suffix(rel.suffix + ".o")
 | 
				
			||||||
        t = scope.target.tools[rule]
 | 
					        t = scope.target.tools[rule]
 | 
				
			||||||
        w.build(str(dest), rule, inputs=src, order_only=t.files)
 | 
					        w.build(
 | 
				
			||||||
 | 
					            str(dest),
 | 
				
			||||||
 | 
					            rule,
 | 
				
			||||||
 | 
					            inputs=src,
 | 
				
			||||||
 | 
					            order_only=t.files,
 | 
				
			||||||
 | 
					            variables={
 | 
				
			||||||
 | 
					                "ck_target": scope.target.id,
 | 
				
			||||||
 | 
					                "ck_component": scope.component.id,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        res.append(str(dest))
 | 
					        res.append(str(dest))
 | 
				
			||||||
    return res
 | 
					    return res
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -185,7 +194,15 @@ def compileRes(
 | 
				
			||||||
    for r in listRes(scope.component):
 | 
					    for r in listRes(scope.component):
 | 
				
			||||||
        rel = Path(r).relative_to(scope.component.subpath("res"))
 | 
					        rel = Path(r).relative_to(scope.component.subpath("res"))
 | 
				
			||||||
        dest = buildpath(scope, "__res__") / rel
 | 
					        dest = buildpath(scope, "__res__") / rel
 | 
				
			||||||
        w.build(str(dest), "cp", r)
 | 
					        w.build(
 | 
				
			||||||
 | 
					            str(dest),
 | 
				
			||||||
 | 
					            "cp",
 | 
				
			||||||
 | 
					            r,
 | 
				
			||||||
 | 
					            variables={
 | 
				
			||||||
 | 
					                "ck_target": scope.target.id,
 | 
				
			||||||
 | 
					                "ck_component": scope.component.id,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        res.append(str(dest))
 | 
					        res.append(str(dest))
 | 
				
			||||||
    return res
 | 
					    return res
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -242,7 +259,16 @@ def link(
 | 
				
			||||||
    res = compileRes(w, scope)
 | 
					    res = compileRes(w, scope)
 | 
				
			||||||
    objs = compileObjs(w, scope)
 | 
					    objs = compileObjs(w, scope)
 | 
				
			||||||
    if scope.component.type == model.Kind.LIB:
 | 
					    if scope.component.type == model.Kind.LIB:
 | 
				
			||||||
        w.build(out, "ar", objs, implicit=res)
 | 
					        w.build(
 | 
				
			||||||
 | 
					            out,
 | 
				
			||||||
 | 
					            "ar",
 | 
				
			||||||
 | 
					            objs,
 | 
				
			||||||
 | 
					            implicit=res,
 | 
				
			||||||
 | 
					            variables={
 | 
				
			||||||
 | 
					                "ck_target": scope.target.id,
 | 
				
			||||||
 | 
					                "ck_component": scope.component.id,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        wholeLibs = collectInjectedLibs(scope)
 | 
					        wholeLibs = collectInjectedLibs(scope)
 | 
				
			||||||
        libs = collectLibs(scope)
 | 
					        libs = collectLibs(scope)
 | 
				
			||||||
| 
						 | 
					@ -254,6 +280,8 @@ def link(
 | 
				
			||||||
                "objs": " ".join(objs),
 | 
					                "objs": " ".join(objs),
 | 
				
			||||||
                "wholeLibs": " ".join(wholeLibs),
 | 
					                "wholeLibs": " ".join(wholeLibs),
 | 
				
			||||||
                "libs": " ".join(libs),
 | 
					                "libs": " ".join(libs),
 | 
				
			||||||
 | 
					                "ck_target": scope.target.id,
 | 
				
			||||||
 | 
					                "ck_component": scope.component.id,
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            implicit=res,
 | 
					            implicit=res,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
| 
						 | 
					@ -308,6 +336,7 @@ def gen(out: TextIO, scope: TargetScope):
 | 
				
			||||||
        w.rule(
 | 
					        w.rule(
 | 
				
			||||||
            i,
 | 
					            i,
 | 
				
			||||||
            f"{tool.cmd} {(tool.rule or rule.rule).replace('$flags',f'${i}flags')}",
 | 
					            f"{tool.cmd} {(tool.rule or rule.rule).replace('$flags',f'${i}flags')}",
 | 
				
			||||||
 | 
					            description=f"{vt100.BLUE}$ck_target{vt100.RESET}/{vt100.CYAN}$ck_component{vt100.RESET}: {vt100.YELLOW}{i} {vt100.FAINT + vt100.WHITE}$out...{vt100.RESET}",
 | 
				
			||||||
            depfile=rule.deps,
 | 
					            depfile=rule.deps,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        w.newline()
 | 
					        w.newline()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue