且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Mac OS X中使用Xcode命令行工具安装了clang-format和clang-format.py在哪里?

更新时间:2022-12-27 17:45:57

似乎苹果不提供 clang-format 。现在您至少有三个选项:

Seems like Apple doesn't ship clang-format with the Command Line Tools. Right now you have at least three options:


  • 使用自制

  • 使用预构建软件包

  • / li>
  • Using Homebrew (That's the way to go)
  • Using prebuild packages
  • Build it yourself

当用户 johnhaley81 指出, clang-format 现在位于自制软件中:

As user johnhaley81 pointed out, clang-format is now in homebrew:


clang-format现在正在制作。 brew install clang-format

请考虑升级他的 post 如果您认为此答案有用。

Please consider upvoting his post if you find this answer useful.

预构建软件包位于 llvm.org 。对于Mac OSX,您需要下载 darwin 包。

Pre-build bundles are available at llvm.org. For Mac OSX, you need to download the darwin package.

以下是有关如何执行此操作的说明:
http://nacho4d-nacho4d.blogspot.de/2013/11/clang-format.html

Here's an instruction on how to do this: http://nacho4d-nacho4d.blogspot.de/2013/11/clang-format.html

这里是另一个:
http://blog.hardcodes.de/articles/63/building-clang-format-and-friends-on-osx-mountain-lion