Other

项目介绍

michaelforney/samurai 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 Other 许可证,目前获得 1.1k 个 Star、62 次 Fork。

仓库全名
michaelforney/samurai
开源许可证
Other
Star 数
1.1k
Fork 数
62
未关闭 Issue
21

README 摘要

samurai samurai is a ninja-compatible build tool written in C99 with a focus on simplicity, speed, and portability. Status samurai implements the ninja build language through version 1.9.0 except for MSVC dependency handling (deps = msvc). It uses the same format for .ninjalog and .ninjadeps as ninja, currently version 5 and 4 respectively. It is feature-complete and supports most of the same options as ninja…

完整内容见 GitHub 原始 README 或本页 。

常见问题

samurai 用什么语言开发?

主要使用 C 编写,采用 Other 许可证,目前有 1.1k 个 Star。

samurai 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 samurai 的源码?

可以直接克隆仓库:git clone https://github.com/michaelforney/samurai.git,默认分支为 master;安装与运行步骤见仓库 README。

samurai 最近还在维护吗?

仓库最近一次更新为 10月6日,当前有 21 个未关闭 Issue;Star 数为 1.1k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

ninja-compatible build tool written in C

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1218
价值分
660
活跃状态
活跃

语言占比

C
Makefile
Roff

Release

README

samurai

builds.sr.ht status GitHub build status

samurai is a ninja-compatible build tool written in C99 with a focus on simplicity, speed, and portability.

Status

samurai implements the ninja build language through version 1.9.0 except for MSVC dependency handling (deps = msvc). It uses the same format for .ninja_log and .ninja_deps as ninja, currently version 5 and 4 respectively.

It is feature-complete and supports most of the same options as ninja.

Requirements

samurai requires various POSIX.1-2008 interfaces.

Scheduling jobs based on load average requires the non-standard getloadavg function. This feature can be enabled by defining HAVE_GETLOADAVG in your CFLAGS, along with any other necessary definitions for your platform.

Spawning subprocesses is done using posix_spawn. If this interface isn’t available on your operating system, define NO_POSIX_SPAWN in your CFLAGS to use fork and exec instead.

samurai uses clock_gettime, which requires -l rt when linking on some operating systems to ensure that this interface is made available. While it is a POSIX requirement to support this flag (even if it’s a no-op), some operating systems don’t. If you get an error about a missing rt library, you can build without it by clearing LDLIBS.

Building

samurai can be built with make. CFLAGS and LDLIBS can be set in the environment, or straight on the command-line.

Differences from ninja

samurai tries to match ninja behavior as much as possible, but there are several cases where it is slightly different:

  • samurai uses the variable lookup order documented in the ninja manual, while ninja has a quirk (ninja-build/ninja#1516) that if the build edge has no variable bindings, the variable is looked up in file scope before the rule-level variables.
  • samurai schedules jobs using a stack, so the last scheduled job is the first to execute, while ninja schedules jobs based on the pointer value of the edge structure (they are stored in a std::set<Edge*>), so the first to execute depends on the address returned by malloc. This may result in build failures due to insufficiently specified dependencies in the project’s build system.
  • samurai does not post-process the job output in any way, so if it includes escape sequences they will be preserved, while ninja strips escape sequences if standard output is not a terminal. Some build systems, like meson, force color output from gcc by default using -fdiagnostics-color=always, so if you plan to save the output to a log, you should pass -Db_colorout=auto to meson.
  • samurai follows the POSIX Utility Syntax Guidelines, in particular guideline 9, so it requires that any command-line options precede the operands. It does not do GNU-style argument permutation.

评论

暂无评论