Xcode-compatible build tool.
Go to file
2023-07-26 11:15:17 -07:00
Libraries Fix hardcoded macOS ln command 2018-08-19 20:13:11 -04:00
Specifications Disable installation 2018-06-03 14:59:26 -04:00
testproject Add a test project 2018-06-03 16:41:48 -04:00
ThirdParty Update gtest to a version with Windows support. 2017-06-19 11:52:20 -07:00
.gitattributes Add notes for GitHub's Linguist tool. 2015-11-04 22:19:26 -08:00
.gitignore Add build-* directories to .gitignore 2016-10-03 13:02:50 -07:00
.gitmodules Add basic PlistBuddy (#111) 2016-09-29 09:19:54 +07:00
.travis.yml Add CI for Windows using AppVeyor and Travis. 2017-06-19 11:52:20 -07:00
appveyor.yml Add CI for Windows using AppVeyor and Travis. 2017-06-19 11:52:20 -07:00
CMakeLists.txt Update CMake Version To 3.13 2023-07-26 11:15:17 -07:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md 2018-01-22 00:49:27 -08:00
CONTRIBUTING.md Update component list in contributing document. 2016-10-01 23:13:45 +07:00
LICENSE Fix minor issues revealed by static analysis. 2016-09-02 22:59:40 -07:00
PATENTS Add README, LICENSE, and PATENTS. Move third-party licenses. 2015-11-04 22:22:30 -08:00
README.md Update README.md 2018-03-21 13:55:37 -07:00

xcbuild

xcbuild is an Xcode-compatible build tool with the goal of providing faster builds, better documentation of the build process and running on multiple platforms (macOS, Linux, and Windows)

Why xcbuild?

Features Performance
🚀Blazing fast incremental buildsxcodebuildxcbuild + Ninja
📖Documents the Xcode build process
🔗Builds Xcode projects and workspaces
🐣Supports Swift apps and frameworksClean Build30.103s25.122s
Tools and libraries for Xcode projects
💝Fully compatible with xcpretty
🎩Uses Ninja and llbuildIncremental Build2.190s0.046s
:octocat:Open source under the BSD license
🐧Builds on Linux and Windows

xcbuild and other build tools

xctool Buck xcpretty
xcbuild and xctool are both Xcode-compatible build systems. We plan on slowly deprecating xctool's build support but keep it as a great way to run tests. Facebook's main build system is Buck. Buck has a stronger architecture and advanced features like artifact caching while having a much simpler build format. If you have a new project, it's highly recommended. xcbuild works great with xcpretty. Pipe the output from xcbuild to xcpretty the same way as you would from xcodebuild.

Building xcbuild

Build Status

Requirements

All platforms

On macOS you can install those tools with Homebrew: brew install cmake ninja.

On Windows you can install those tools with Chocolatey: choco install cmake ninja.

Linux

  • GCC 4.8 or later. libpng16-dev, zlib1g-dev, libxml2-dev, and pkg-config are also required.

macOS

  • Xcode 7 or later.

Windows

  • Visual Studio 2015 or later, on Windows. A zlib DLL is also required.

Instructions

All platforms

git clone --depth=1 https://github.com/facebook/xcbuild
cd xcbuild
git submodule update --init

Linux and macOS:

make

Build output will be in the build directory. Run xcbuild with ./build/xcbuild.

You can place xcbuild in your bin directory to run it from other locations: mv build/xcbuild /usr/local/bin/.

Windows (experimental):

cmake -Bbuild -H. -G "Visual Studio 14 2015" -DZLIB_ROOT=<path>

Open build\xcbuild.sln and build.

Usage

The command line options are compatible with xcodebuild.

xcbuild -workspace Example.xcworkspace -scheme Example

Using Ninja (or llbuild)

To switch to the significantly faster Ninja executor:

xcbuild -executor ninja [-workspace Example.xcworkspace ...]

Besides the -executor ninja parameters, the options are otherwise identical. The Ninja executor is fastest if it can avoid re-generating the Ninja files if the build configuration and input project files do not change.

Contributing

xcbuild actively welcomes contributions from the community. If you're interested in contributing, be sure to check out the contributing guide. It includes some tips for getting started in the codebase, as well as important information about the code of conduct, license, and CLA.

Thanks

xcbuild is built on build system documentation from the community. In particular, thanks to these people for their writing:

Third-party licenses are listed in the LICENSE document.