Allow .asm files and set default target.
This commit is contained in:
		
							parent
							
								
									4b99ba40cf
								
							
						
					
					
						commit
						a290e8388c
					
				
					 4 changed files with 6 additions and 7 deletions
				
			
		|  | @ -36,14 +36,14 @@ def runCmd(opts: dict, args: list[str]) -> None: | |||
|         print(f"Usage: {args[0]} run <component>") | ||||
|         sys.exit(1) | ||||
| 
 | ||||
|     out = build.buildOne(opts.get('target', 'host-clang'), args[0]) | ||||
|     out = build.buildOne(opts.get('target', 'default'), args[0]) | ||||
| 
 | ||||
|     print(f"{utils.Colors.BOLD}Running: {args[0]}{utils.Colors.RESET}") | ||||
|     utils.runCmd(out, *args[1:]) | ||||
| 
 | ||||
| 
 | ||||
| def buildCmd(opts: dict, args: list[str]) -> None: | ||||
|     targetName = opts.get('target', 'host-clang') | ||||
|     targetName = opts.get('target', 'default') | ||||
| 
 | ||||
|     if len(args) == 0: | ||||
|         build.buildAll(targetName) | ||||
|  | @ -53,7 +53,7 @@ def buildCmd(opts: dict, args: list[str]) -> None: | |||
| 
 | ||||
| 
 | ||||
| def listCmd(opts: dict, args: list[str]) -> None: | ||||
|     targetName = opts.get('target', 'host-clang') | ||||
|     targetName = opts.get('target', 'default') | ||||
|     target = targets.load(targetName) | ||||
|     components = manifests.loadAll("src", target) | ||||
| 
 | ||||
|  |  | |||
|  | @ -58,7 +58,7 @@ def genNinja(out: TextIO, manifests: dict, target: dict) -> None: | |||
|             elif obj[1].endswith(".cpp"): | ||||
|                 writer.build( | ||||
|                     obj[0], "cxx", obj[1], order_only=target["tools"]["cxx"].get("files", "")) | ||||
|             elif obj[1].endswith(".s"): | ||||
|             elif obj[1].endswith(".s") or obj[1].endswith(".asm"): | ||||
|                 writer.build( | ||||
|                     obj[0], "as", obj[1], order_only=target["tools"]["as"].get("files", "")) | ||||
| 
 | ||||
|  |  | |||
|  | @ -88,7 +88,7 @@ def findFiles(manifests: dict) -> dict: | |||
|         assetsPath = os.path.join(path, "assets") | ||||
| 
 | ||||
|         item["tests"] = utils.findFiles(testsPath, [".c", ".cpp"]) | ||||
|         item["srcs"] = utils.findFiles(path, [".c", ".cpp", ".s"]) | ||||
|         item["srcs"] = utils.findFiles(path, [".c", ".cpp", ".s", ".asm"]) | ||||
|         item["assets"] = utils.findFiles(assetsPath) | ||||
| 
 | ||||
|     return manifests | ||||
|  |  | |||
|  | @ -187,11 +187,10 @@ def loadJson(filename: str) -> dict: | |||
|         result = CACHE[filename] | ||||
|     else: | ||||
|         with open(filename) as f: | ||||
|             result = json.load(f) | ||||
|             result = processJson(json.load(f)) | ||||
| 
 | ||||
|             result["dir"] = os.path.dirname(filename) | ||||
|             result["json"] = filename | ||||
|             result = processJson(result) | ||||
|             CACHE[filename] = result | ||||
| 
 | ||||
|     result = copy.deepcopy(result) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue