1 Star 0 Fork 11

Dragon/BearPi-Pico_H2821

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.py 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
BearPi 提交于 2024-06-06 10:05 . first commit
#!/usr/bin/env python3
# encoding=utf-8
# ============================================================================
# @brief build system entry, receive param & start to build
# Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.
# ============================================================================
"""
接收参数列表及解释:
-c:
clean后编译
-j:
-j<num>, 以num线程数编译
默认为机器最大线程数
-def=:
-def=XXX,YYY,ZZZ=x,... 向本次编译target中添加XXX、YYY、ZZZ=x编译宏
可使用-def=-:XXX 来屏蔽XXX宏
可使用-def=-:ZZZ=x 来添加或者修改ZZZ宏
-component=:
-component=XXX,YYY,... 仅编译XXX,YYY组件
-ninja:
使用ninja生成中间文件
默认使用Unix makefile
-[release/debug]:
debug: 在生成反汇编文件时信息更加全面但也更耗时
release: 在生成反汇编文件时节省时间
默认为debug
-dump:
输出target的编译参数
-nhso:
不更新HSO数据库
-out_libs:
-out_libs=file_path, 不再链接成elf, 转而将所有.a打包成一个大的.a
others:
作为匹配编译target_names的关键字
"""
import os
import sys
from distutils.spawn import find_executable
sys.dont_write_bytecode = True
root_dir = os.path.split(os.path.realpath(__file__))[0]
sys.path.append(os.path.join(root_dir, 'build', 'config'))
sys.path.append(os.path.join(root_dir, 'build', 'script'))
from cmake_builder import CMakeBuilder
def check_enviroment():
if not find_executable("cmake"):
print("cmake is not installed or not added to system path.")
if not find_executable("ninja") and not find_executable("make"):
print("make/ninja is not installed or not added to system path.")
builder = CMakeBuilder(sys.argv)
builder.build()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hbu-dragon/bearpi-h2821_pico.git
git@gitee.com:hbu-dragon/bearpi-h2821_pico.git
hbu-dragon
bearpi-h2821_pico
BearPi-Pico_H2821
master

搜索帮助