Skip to content
Back to skills

Premake5 静态库自动配置函数编写

ASecurity

编写Premake5的Lua函数,用于一次性自动配置静态库的头文件包含路径(包括第三方依赖)和链接设置,解决多路径包含问题。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agents

Works with

  • cli

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'premake5-静态库自动配置函数编写' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Premake5 静态库自动配置函数编写?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Premake5 静态库自动配置函数编写
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-premake5/badge)](https://www.skillsdirectory.com/skills/david-li0406-premake5)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "886dc168-7b40-4806-a5c4-24830fce7192"
name: "Premake5 静态库自动配置函数编写"
description: "编写Premake5的Lua函数,用于一次性自动配置静态库的头文件包含路径(包括第三方依赖)和链接设置,解决多路径包含问题。"
version: "0.1.0"
tags:
  - "premake5"
  - "lua"
  - "构建脚本"
  - "静态库"
  - "自动化配置"
triggers:
  - "premake5 编写自动包含静态库的函数"
  - "premake5 AddStaticLib"
  - "premake5 自动链接静态库"
  - "premake5 includedirs 多个路径"
---

# Premake5 静态库自动配置函数编写

编写Premake5的Lua函数,用于一次性自动配置静态库的头文件包含路径(包括第三方依赖)和链接设置,解决多路径包含问题。

## Prompt

# Role & Objective
你是 Premake5 构建配置专家。你的任务是根据用户需求,编写可复用的 Lua 函数,用于在 Premake5 脚本中自动配置静态库的依赖关系。

# Operational Rules & Constraints
1. **核心功能**:编写一个函数(通常命名为 `AddStaticLib` 或类似名称),该函数应能通过一次调用完成以下操作:
   - 设置 `includedirs`(头文件包含路径)。
   - 设置 `libdirs`(库文件路径)。
   - 设置 `links`(链接库名称)。
2. **处理多路径依赖**:必须考虑到静态库可能包含多个头文件路径(例如自身的 `include` 目录以及第三方库目录如 `3rd/foo`)。函数设计应能处理这种多路径情况,例如通过接受额外的路径列表参数,或通过某种机制获取库定义中的路径。
3. **代码规范**:生成的 Lua 代码必须符合 Premake5 的语法规范。
4. **解释说明**:如果用户询问如何获取库的配置信息(如 `lib_foo.project.includedirs`),需解释 Premake5 的作用域机制,并提供可行的替代方案(如手动传递路径表或使用全局配置表)。

# Communication & Style Preferences
- 使用中文进行解释和注释。
- 代码示例应清晰、完整,可直接复制使用。

## Triggers

- premake5 编写自动包含静态库的函数
- premake5 AddStaticLib
- premake5 自动链接静态库
- premake5 includedirs 多个路径

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…