Code Monkey home page Code Monkey logo

ccache.cmake's Introduction

Actions Status

Ccache.cmake

A simple, Xcode compatible Ccache integration for CMake, based on this article by Craig Scott.

About

Ccache is a compiler cache that can drastically improve build times for C and C++ projects. This script makes it easy to configure a CMake project to use Ccache by adding the configuration option USE_CCACHE which will active Ccache support when enabled. Build-specific environmental variables can be set with the CCACHE_OPTIONS configuration parameter. It is currently compatible with Makefile, Ninja and Xcode generators. Example usage:

cmake . -DUSE_CCACHE=YES -DCCACHE_OPTIONS="CCACHE_CPP2=true;CCACHE_SLOPPINESS=clang_index_store"

How to integrate

Using CPM.cmake (recommended)

Run the following from the project's root directory to add CPM to your project.

mkdir -p cmake
wget -O cmake/CPM.cmake https://raw.githubusercontent.com/TheLartians/CPM/master/cmake/CPM.cmake

Add the following lines to the project's CMakeLists.txt after calling project(...).

include(cmake/CPM.cmake)

CPMAddPackage(
  NAME Ccache.cmake
  GITHUB_REPOSITORY TheLartians/Ccache.cmake
  VERSION 1.2
)

Using git submodules (not suited for libraries)

Run the following from the project's root directory.

git submodule add https://github.com/TheLartians/Ccache.cmake 

In add the following lines to the project's CMakeLists.txt after calling project(...).

add_subdirectory(Ccache.cmake)

Dependencies

Ccache.cmake requires CMake and Ccache.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.