diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..66534e4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,98 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-linux: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + package-cache: true + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential + + - name: Install Xlings + run: curl -fsSL https://d2learn.org/xlings-install.sh | bash + + - name: Install GCC 15.1 with Xlings + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xlings install gcc@15.1 -y + + - name: Build + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xmake f -m release -y -vv + xmake -y -vv -j$(nproc) + + - name: Test + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xmake run templates_test + + - name: Run examples + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xmake run basic + + build-macos: + runs-on: macos-14 + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: brew install xmake llvm@20 + + - name: Build + run: | + export PATH=/opt/homebrew/opt/llvm@20/bin:$PATH + xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 -m release -y -vv + xmake -y -vv -j$(sysctl -n hw.ncpu) + + build-windows: + runs-on: windows-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + package-cache: true + + - name: Build + run: | + xmake f -m release -y -vv + xmake -y -vv -j$env:NUMBER_OF_PROCESSORS + + - name: Test + run: xmake run templates_test + + - name: Run examples + run: xmake run basic diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..278d91b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,152 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: "Release version (e.g., 0.1.1)" + required: true + type: string + +jobs: + build-linux: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential + + - name: Install Xlings + run: curl -fsSL https://d2learn.org/xlings-install.sh | bash + + - name: Install GCC 15.1 with Xlings + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xlings install gcc@15.1 -y + + - name: Build with xmake + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xmake f -m release -y -vv + xmake -y -vv -j$(nproc) + + - name: Run tests + run: | + export PATH=/home/xlings/.xlings_data/bin:$PATH + xmake run templates_test + + - name: Create release package + run: | + PKG="mcpplibs-templates-${{ inputs.version }}-linux-x86_64" + mkdir -p "$PKG" + cp build/linux/x86_64/release/libmcpplibs-templates.a "$PKG/" + cp src/templates.cppm README.md LICENSE "$PKG/" + tar -czf "${PKG}.tar.gz" "$PKG" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: templates-linux-x86_64 + path: mcpplibs-templates-${{ inputs.version }}-linux-x86_64.tar.gz + + build-macos: + runs-on: macos-14 + timeout-minutes: 25 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: brew install xmake llvm@20 + + - name: Build with xmake (LLVM 20) + run: | + export PATH=/opt/homebrew/opt/llvm@20/bin:$PATH + xmake f -p macosx -m release --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 -y -vv + xmake -y -vv -j$(sysctl -n hw.ncpu) + + - name: Create release package + run: | + PKG="mcpplibs-templates-${{ inputs.version }}-macosx-arm64" + mkdir -p "$PKG" + cp build/macosx/arm64/release/libmcpplibs-templates.a "$PKG/" + cp src/templates.cppm README.md LICENSE "$PKG/" + tar -czf "${PKG}.tar.gz" "$PKG" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: templates-macosx-arm64 + path: mcpplibs-templates-${{ inputs.version }}-macosx-arm64.tar.gz + + build-windows: + runs-on: windows-latest + timeout-minutes: 25 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + + - name: Build with xmake + run: | + xmake f -m release -y -vv + xmake -y -vv -j$env:NUMBER_OF_PROCESSORS + + - name: Run tests + run: xmake run templates_test + + - name: Create release package + shell: pwsh + run: | + $pkg = "mcpplibs-templates-${{ inputs.version }}-windows-x86_64" + New-Item -ItemType Directory -Path $pkg -Force | Out-Null + Copy-Item "build\windows\x64\release\mcpplibs-templates.lib" -Destination "$pkg\" + Copy-Item "src\templates.cppm" -Destination "$pkg\" + Copy-Item "README.md" -Destination "$pkg\" + Copy-Item "LICENSE" -Destination "$pkg\" + Compress-Archive -Path $pkg -DestinationPath "$pkg.zip" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: templates-windows-x86_64 + path: mcpplibs-templates-${{ inputs.version }}-windows-x86_64.zip + + create-release: + needs: [build-linux, build-macos, build-windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ inputs.version }} + name: ${{ inputs.version }} + draft: false + prerelease: false + files: | + artifacts/templates-linux-x86_64/mcpplibs-templates-${{ inputs.version }}-linux-x86_64.tar.gz + artifacts/templates-macosx-arm64/mcpplibs-templates-${{ inputs.version }}-macosx-arm64.tar.gz + artifacts/templates-windows-x86_64/mcpplibs-templates-${{ inputs.version }}-windows-x86_64.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 70eeb6b..fb6e4ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,48 @@ -.xlings +# xmake .xmake -build \ No newline at end of file +build + +# xlings +.xlings + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Debug information files +*.dwo +*.d + +# CMake +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt index dc7e225..bd594ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,19 +7,24 @@ set(CMAKE_CXX_MODULE_STD 1) project(mcpplibs-templates VERSION 1.0.0 LANGUAGES CXX) -# Library target +# Library add_library(mcpplibs-templates STATIC) +file(GLOB_RECURSE MODULE_SOURCES "src/*.cppm") + target_sources(mcpplibs-templates PUBLIC FILE_SET CXX_MODULES FILES - src/templates.cppm + ${MODULE_SOURCES} ) -# Test executable -add_executable(tests tests/main.cpp) -target_link_libraries(tests PRIVATE mcpplibs-templates) +# Test +add_executable(templates_test tests/main.cpp) +target_link_libraries(templates_test PRIVATE mcpplibs-templates) -# Enable testing enable_testing() -add_test(NAME mcpplibs-templates-test COMMAND tests) \ No newline at end of file +add_test(NAME mcpplibs-templates-test COMMAND templates_test) + +# Example +add_executable(basic examples/basic.cpp) +target_link_libraries(basic PRIVATE mcpplibs-templates) diff --git a/README.md b/README.md index a83903e..d38f923 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,95 @@ # mcpplibs templates -mcpplibs templates... +> C++23 模块化库项目模板 - `import mcpplibs.templates;` -`src/templates.cppm` +基于 C++23 模块的库项目模板,提供标准化的项目结构、构建配置和 CI/CD 流水线,帮助快速创建 mcpplibs 风格的模块化 C++ 库。 -```cpp -module; // 0 - global module declaration - -// 1 - include & macro area -// #include +## 特性 -// 2 - module declaration -export module mcpplibs.templates; - -// 3 - import area -import std; +- **C++23 模块** — `import mcpplibs.templates;` +- **双构建系统** — 同时支持 xmake 和 CMake +- **CI/CD** — GitHub Actions 多平台构建(Linux / macOS / Windows) +- **标准化结构** — 遵循 [mcpp-style-ref](https://github.com/mcpp-community/mcpp-style-ref) 编码规范 +- **开箱即用** — 包含示例、测试和架构文档 -// 4 - module implementation partition -namespace mcpplibs { +## 项目结构 - // 5 - exported entities - export void hello_mcpp() { - std::println("hello mcpp!"); - } - -} // namespace mcpplibs +``` +mcpplibs-templates/ +├── src/ # 模块源码 +│ └── templates.cppm # 主模块接口 +├── tests/ # 测试 +│ ├── main.cpp +│ └── xmake.lua +├── examples/ # 示例 +│ ├── basic.cpp +│ └── xmake.lua +├── docs/ # 文档 +│ └── architecture.md +├── .github/workflows/ # CI/CD +│ └── ci.yml +├── xmake.lua # xmake 构建配置 +├── CMakeLists.txt # CMake 构建配置 +└── config.xlings # xlings 工具链配置 ``` -`tests/main.cpp` +## 快速开始 ```cpp -// 6 - import module +import std; import mcpplibs.templates; -auto main() -> int { - // 7 - call exported function - mcpplibs::hello_mcpp(); +int main() { + mcpplibs::templates::hello_mcpp(); + return 0; } ``` -## Install & Config +## 安装与配置 ```bash xlings install ``` -## Build & Run +## 构建与运行 -**Using xmake** +**使用 xmake** ```bash -xmake build -xmake r +xmake build # 构建库 +xmake run basic # 运行基础示例 +xmake run templates_test # 运行测试 ``` -**Using CMake** +**使用 CMake** ```bash cmake -B build -G Ninja cmake --build build -./build/tests +ctest --test-dir build +``` + +## 集成到构建工具 + +### xmake + +```lua +add_repositories("mcpplibs-index https://github.com/mcpplibs/mcpplibs-index.git") + +add_requires("templates") + +target("myapp") + set_kind("binary") + set_languages("c++23") + add_files("main.cpp") + add_packages("templates") + set_policy("build.c++.modules", true) ``` -## Other +## 相关链接 +- [mcpp-style-ref | 现代C++编码/项目风格参考](https://github.com/mcpp-community/mcpp-style-ref) +- [mcpplibs/cmdline | 命令行解析库](https://github.com/mcpplibs/cmdline) +- [mcpp社区官网](https://mcpp.d2learn.org) +- [mcpp | 现代C++爱好者论坛](https://mcpp.d2learn.org/forum) - [入门教程: 动手学现代C++](https://github.com/Sunrisepeak/mcpp-standard) -- [mcpp | 现代C++爱好者论坛](https://forum.d2learn.org/category/20) -- [mcpp-community | 现代C++爱好者社区](https://github.com/mcpp-community) -- [d2learn社区](https://github.com/d2learn) \ No newline at end of file diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..0ee2b6c --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,250 @@ +# 架构文档 + +> mcpplibs/templates 项目架构与设计说明 + +## 概述 + +`mcpplibs/templates` 是 mcpplibs 生态中的标准化 C++23 模块库项目模板。它提供了一套完整的项目骨架,包含模块源码、测试、示例、构建配置和 CI/CD 流水线,帮助开发者快速创建符合 [mcpp-style-ref](https://github.com/mcpp-community/mcpp-style-ref) 编码规范的模块化 C++ 库。 + +## 目录结构 + +``` +mcpplibs-templates/ +├── src/ # 模块源码目录 +│ └── templates.cppm # 主模块接口文件 +├── tests/ # 测试目录 +│ ├── main.cpp # 测试入口 +│ └── xmake.lua # 测试构建配置 +├── examples/ # 示例目录 +│ ├── basic.cpp # 基础用法示例 +│ └── xmake.lua # 示例构建配置 +├── docs/ # 文档目录 +│ └── architecture.md # 架构文档(本文件) +├── .github/workflows/ # CI/CD 配置 +│ └── ci.yml # GitHub Actions 流水线 +├── xmake.lua # xmake 构建配置(主配置) +├── CMakeLists.txt # CMake 构建配置 +├── config.xlings # xlings 工具链配置 +├── .gitignore # Git 忽略规则 +├── .gitattributes # Git 属性(.cppm 语言识别) +├── LICENSE # Apache-2.0 许可证 +└── README.md # 项目说明 +``` + +## 模块架构 + +### 模块结构 + +```mermaid +graph TD + subgraph moduleLayer [模块层] + M["mcpplibs.templates"] + end + + subgraph srcLayer [源码] + S["src/templates.cppm"] + end + + subgraph consumerLayer [使用方] + T["tests/main.cpp"] + E["examples/basic.cpp"] + end + + S -->|"export module"| M + T -->|"import"| M + E -->|"import"| M +``` + +### 模块命名规范 + +遵循 [mcpp-style-ref 2.4 模块命名规范](https://github.com/mcpp-community/mcpp-style-ref#24-%E6%A8%A1%E5%9D%97%E5%8F%8A%E6%A8%A1%E5%9D%97%E5%88%86%E5%8C%BA%E5%91%BD%E5%90%8D%E8%A7%84%E8%8C%83): + +- **模块名格式**: `组织.库名` — 例: `mcpplibs.templates` +- **模块分区**: `组织.库名:分区名` — 例: `mcpplibs.templates:utils` +- **命名空间**: 与模块名对应 — 例: `mcpplibs::templates` + +### 模块文件结构 + +每个 `.cppm` 文件遵循以下结构: + +```cpp +module; // 全局模块片段(可选,用于传统头文件) + +export module mcpplibs.templates; // 模块声明 + +import std; // 模块导入区域 + +namespace mcpplibs::templates { // 接口导出与实现 + + export void hello_mcpp() { + std::println("hello mcpp!"); + } + +} +``` + +### 扩展模块分区 + +当库规模增长时,可按照 [mcpp-style-ref 2.5](https://github.com/mcpp-community/mcpp-style-ref#25-%E5%A4%9A%E6%96%87%E4%BB%B6%E6%A8%A1%E5%9D%97%E5%92%8C%E7%9B%AE%E5%BD%95) 的模式拆分为多个模块分区: + +``` +src/ +├── templates.cppm # 主模块,export import 各分区 +├── templates/ +│ ├── core.cppm # export module mcpplibs.templates:core +│ └── utils.cppm # export module mcpplibs.templates:utils +``` + +主模块文件中聚合导出: + +```cpp +export module mcpplibs.templates; + +export import :core; +export import :utils; +``` + +## 编码规范 + +遵循 [mcpp-style-ref](https://github.com/mcpp-community/mcpp-style-ref) 编码规范: + +| 类别 | 风格 | 示例 | +|------|------|------| +| 类型名 | PascalCase(大驼峰) | `StyleRef`, `HttpServer` | +| 对象/数据成员 | camelCase(小驼峰) | `fileName`, `configText` | +| 函数 | snake_case(下划线) | `load_config()`, `parse_()` | +| 私有成员 | `_` 后缀 | `data_`, `parse_()` | +| 命名空间 | 全小写 | `mcpplibs`, `mcpplibs::templates` | +| 全局变量 | `g` 前缀 | `gStyleRef` | + +## 构建系统 + +### 构建流程 + +```mermaid +graph LR + subgraph xmakeBuild [xmake 构建] + X1["xmake.lua"] -->|includes| X2["tests/xmake.lua"] + X1 -->|includes| X3["examples/xmake.lua"] + X1 -->|"target: mcpplibs-templates"| LIB["静态库"] + X2 -->|"target: templates_test"| TEST["测试可执行文件"] + X3 -->|"target: basic"| EXAMPLE["示例可执行文件"] + end +``` + +### xmake + +主构建配置 `xmake.lua` 定义静态库 target,并通过 `includes` 引入子目录的构建配置: + +```lua +add_rules("mode.release", "mode.debug") +set_languages("c++23") + +target("mcpplibs-templates") + set_kind("static") + add_files("src/*.cppm", { public = true, install = true }) + set_policy("build.c++.modules", true) + +includes("examples", "tests") +``` + +关键配置说明: +- `set_languages("c++23")` — 启用 C++23 标准 +- `add_files("src/*.cppm", { public = true, install = true })` — 通配模块源文件,支持自动发现新增分区 +- `set_policy("build.c++.modules", true)` — 启用 C++20/23 模块支持 +- `includes("examples", "tests")` — 引入子目录构建配置,保持主文件简洁 + +### CMake + +`CMakeLists.txt` 提供对 CMake 4.0+ 的支持,使用实验性 `import std` 功能: + +```cmake +cmake_minimum_required(VERSION 4.0.2) +set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "a9e1cf81-9932-4810-974b-6eccaf14e457") +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_MODULE_STD 1) +``` + +### 工具链配置 + +`config.xlings` 定义项目所需的工具链版本: + +```lua +xname = "mcpplibs-templates" + +xim = { + xmake = "3.0.4", + cmake = "4.0.2", + ninja = "1.12.1", + cpp = "", -- gcc15 或 mingw13 +} +``` + +通过 `xlings install` 可一键安装所有依赖工具。 + +## CI/CD 流水线 + +### 多平台构建矩阵 + +```mermaid +graph TD + subgraph ciPipeline [GitHub Actions CI] + TRIGGER["push / pull_request"] --> LINUX["Linux"] + TRIGGER --> MACOS["macOS"] + TRIGGER --> WINDOWS["Windows"] + + LINUX -->|"GCC 15.1 via Xlings"| L_BUILD["构建 + 测试 + 示例"] + MACOS -->|"LLVM 20 via Homebrew"| M_BUILD["仅构建"] + WINDOWS -->|"MSVC"| W_BUILD["构建 + 测试 + 示例"] + end +``` + +| 平台 | 编译器 | 构建 | 测试 | 示例 | +|------|--------|------|------|------| +| Linux (Ubuntu) | GCC 15.1 | Y | Y | Y | +| macOS | LLVM 20 | Y | - | - | +| Windows | MSVC | Y | Y | Y | + +macOS 当前仅构建不运行测试和示例,因为部分模块特性在 Clang/LLVM 上的支持仍在完善中。 + +## 如何基于模板创建新库 + +1. **克隆模板** + +```bash +git clone https://github.com/mcpplibs/templates.git mcpplibs-mylib +cd mcpplibs-mylib +rm -rf .git && git init +``` + +2. **重命名模块** + +将 `templates` 替换为你的库名(例如 `mylib`): + +- `src/templates.cppm` → 修改 `export module mcpplibs.mylib;` +- `xmake.lua` → 修改 target 名称为 `mcpplibs-mylib` +- `CMakeLists.txt` → 修改 project 和 target 名称 +- `config.xlings` → 修改 `xname` + +3. **添加模块分区**(按需) + +在 `src/` 下创建新的 `.cppm` 文件,xmake 会通过通配符 `src/*.cppm` 自动发现。 + +4. **编写测试和示例** + +在 `tests/` 和 `examples/` 下添加对应的源文件和 xmake target。 + +5. **推送并验证 CI** + +```bash +git add . +git commit -m "init: mcpplibs-mylib" +git remote add origin https://github.com/mcpplibs/mylib.git +git push -u origin main +``` + +## 参考 + +- [mcpp-style-ref | 现代C++编码/项目风格参考](https://github.com/mcpp-community/mcpp-style-ref) +- [mcpplibs/cmdline | 命令行解析库(参考项目)](https://github.com/mcpplibs/cmdline) +- [mcpp社区官网](https://mcpp.d2learn.org) diff --git a/examples/basic.cpp b/examples/basic.cpp new file mode 100644 index 0000000..e43bb29 --- /dev/null +++ b/examples/basic.cpp @@ -0,0 +1,8 @@ +import std; +import mcpplibs.templates; + +int main() { + std::println("=== mcpplibs.templates basic example ==="); + mcpplibs::templates::hello_mcpp(); + return 0; +} diff --git a/examples/xmake.lua b/examples/xmake.lua new file mode 100644 index 0000000..7564132 --- /dev/null +++ b/examples/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +set_languages("c++23") + +target("basic") + set_kind("binary") + add_files("basic.cpp") + add_deps("mcpplibs-templates") + set_policy("build.c++.modules", true) diff --git a/src/templates.cppm b/src/templates.cppm index d987b07..e10e70f 100644 --- a/src/templates.cppm +++ b/src/templates.cppm @@ -1,20 +1,13 @@ -module; // 0 - global module declaration +module; -// 1 - include & macro area -// #include - -// 2 - module declaration export module mcpplibs.templates; -// 3 - import area import std; -// 4 - module implementation partition -namespace mcpplibs { +namespace mcpplibs::templates { - // 5 - exported entities export void hello_mcpp() { std::println("hello mcpp!"); } -} // namespace mcpplibs \ No newline at end of file +} diff --git a/tests/main.cpp b/tests/main.cpp index 300a130..0691005 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,7 +1,15 @@ -// 6 - import module +#include + import mcpplibs.templates; -auto main() -> int { - // 7 - call exported function - mcpplibs::hello_mcpp(); -} \ No newline at end of file +TEST(TemplatesTest, HelloMcpp) { + testing::internal::CaptureStdout(); + mcpplibs::templates::hello_mcpp(); + std::string output = testing::internal::GetCapturedStdout(); + EXPECT_EQ(output, "hello mcpp!\n"); +} + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tests/xmake.lua b/tests/xmake.lua new file mode 100644 index 0000000..9a52dc4 --- /dev/null +++ b/tests/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +set_languages("c++23") + +add_requires("gtest") + +target("templates_test") + set_kind("binary") + add_files("*.cpp") + add_deps("mcpplibs-templates") + add_packages("gtest") + set_policy("build.c++.modules", true) diff --git a/xmake.lua b/xmake.lua index b5ce3f8..cebee86 100644 --- a/xmake.lua +++ b/xmake.lua @@ -4,10 +4,9 @@ set_languages("c++23") target("mcpplibs-templates") set_kind("static") - add_files("src/templates.cppm", { public = true, install = true }) + add_files("src/*.cppm", { public = true, install = true }) + set_policy("build.c++.modules", true) -target("tests") - set_kind("binary") - add_files("tests/main.cpp") - add_deps("mcpplibs-templates") - --set_policy("build.c++.modules", true) \ No newline at end of file +if not is_host("macosx") then + includes("examples", "tests") +end