Files
gjm 5993d6bda4 新增 ai.memory 项目记忆目录,供跨机器 CodeBuddy CLI 读取
包含工程概览、构建系统、模块划分、决策记录与约定,
随仓库同步以便在不同电脑上保持上下文连续性。
2026-09-28 15:58:16 +08:00

58 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 构建系统
**结论:现在统一用 CMake 构建,不再使用 Visual Studio 工程文件(`.vcxproj`/`.sln` 已删除)。**
## 基本命令
```bash
# 在 SourceCode/Code2026 目录
cmake --preset R250 # 配置(示例:AutoCAD 2025-2026)
cmake --build --preset R250 # 编译
```
- CMake ≥ 3.21,生成器 `Visual Studio 18 2026`,架构 `x64`。
- 工具集按 preset 指定(如 `v143` / `v142` / `v141` …)。
- 启用 `/MP` 多进程编译;Release 默认 `_NDEBUG`。
## 配置预设(`cmakepresets.json`,13 套)
| 分组 | preset | 说明 |
| --- | --- | --- |
| AutoCAD | `R180 R190 R200 R210 R220 R230 R240 R243 R250 R260` | ARX 18~26(CAD 2010~2027) |
| 中望CAD | `Z2023 Z2024 Z2025 Z2026` | ZRX 2023~2026 |
关键 cache 变量:
- `CAD_SDK_ROOT`:`arx/` 或 `zrx/`(相对 `SourceCode/Code2026` 上一级的上一级)。
- `DEP_LIB_ROOT` / `DEP_INC_ROOT`:`../dep_lib` / `../dep_inc`。
- `PRODUCT=ENV_2025_V6_S0`、`TRIAL_YEAR=2026`。
- `GENERATE_BIN_DIR` / `GENERATE_LIB_DIR`:输出到 `bin/Code2026`、`lib/Code2026`。
C++ 标准自动切换:ARX 26→C++20;ARX 25/24 与 ZRX→C++14;更老版本→C++03/98。
## 构建脚本
- `cmake/functions.cmake`:核心封装
- `add_custom_module(dir folder)`:注册子模块(自动 `add_subdirectory` + 设置 FOLDER)。
- `target_link_objectarx(target EXT)`:链接 CAD SDK 与全局头。
- `simple_link_cad_sdk`:自动区分 ARX / ZRX。
- `set_encryption_definitions_and_output_path`:**授权模式**,生成 `BAL_REMOTE` 与 `TRIAL_YEAR` 两种版本。
- `set_debug_post_build`:调用 `copyarx.exe` 做 post-build 部署。
- `cmake/ThirdPartyDeps.cmake`:定义 `ThirdParty::ARX` / `ZRX` / `SQLite3` / `cURL` / `TG` / `modernGlue` / `BitAnswer` 等接口目标。
- 顶层 `cmakelists.txt`:注册所有模块并组织 `FOLDER`(`SH/Core`、`SH/Pipe` …)。
## 授权 / 加密
- `CoreCommand` 通过 `get_encryption_modes()` 生成两种产物:
- `BAL_REMOTE`(网络锁 / 正式版)
- `TRIAL_YEAR`(1 年期试用版)
- 依赖 **BitAnswer**(加密狗库),加密表由 `utility/generateEncryptionTable` 生成。
## 部署与打包
- **部署**:`sh_output_path.json`(ACAD)/ `zw_output_path.json`(中望)定义从 `bin/Code2026` 拷贝到安装目录 `c:\ShangHuaSoft\Envi3D-2026-M`;由 `copyarx.exe` 执行。
- **打包**:`autoCompile/` 内含 Inno Setup(`*.iss`) + Python(`SHSCompile.py`) + 多个 `.bat`,覆盖 ACAD/中望、1年期/加密版、以及客户专版(中广核、国能集团等)。
## .gitignore 要点
忽略:`Arx/`、`cmake_output/`、`bin/`、`lib/`,以及所有 VS 中间产物(`*.obj/*.pdb/*.user/.vs` 等)。