把静态库换成源码方便调试

This commit is contained in:
2026-08-25 10:20:14 +08:00
parent 0e6a93c12d
commit e0f5da6f39
18 changed files with 7061 additions and 36 deletions
+6 -21
View File
@@ -107,27 +107,8 @@ SKIP_PATH_PREFIXES: List[str] = [
# remove_extra : 额外删除的相对路径(相对模块根)
# keep_extra : 额外强制保留的相对路径(文件或目录,相对模块根)
# ---------------------------------------------------------------------------
MODULE_CONFIG: Dict[str, dict] = {
"apps/usr_le_code": {
"public_headers": [
"usr_le_api.h",
"usr_le_product.h",
],
"remove_patterns": [
"*.c",
"*.cpp",
"*.cc",
],
"remove_internal_headers": True,
"prune_empty_dirs": True,
"remove_extra": [
"build_lib.bat",
],
"keep_extra": [
"lib/",
],
},
}
# 本产品工程 usr_le_code 已改为源码编译,交付时不再抽成 .a
MODULE_CONFIG: Dict[str, dict] = {}
# =============================================================================
@@ -405,6 +386,7 @@ def sanitize_release_makefile(release_dir: Path) -> None:
"""
@brief 调整 Release 副本中的 Makefile:仅链接预编译 libusr_le_code.a
开发工程 Makefile 不动;客户包不得再尝试用已删除源码重建库
本产品工程已改为源码直编,无 USR_LE_SRC_FILES 时直接跳过
@param release_dir Release 根目录
"""
makefile = release_dir / "Makefile"
@@ -413,6 +395,9 @@ def sanitize_release_makefile(release_dir: Path) -> None:
return
text = makefile.read_text(encoding="utf-8")
if "USR_LE_SRC_FILES" not in text:
print("[INFO] Makefile already compiles usr_le_code from source, skip sanitize")
return
# 1) 去掉源码列表与 OBJS,仅保留预编译库路径
text2, n1 = re.subn(