Using Clang instead of GCC

From NixOS Wiki
Revision as of 15:03, 2 May 2018 by imported>Mickours (Add the trick to override package and build with Clang)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You can use Clang instead of GCC as a compiler for any package by overriding `stdenv`:

{ pkgs, my_package }:
my_package.override {
    # use Clang instead of GCC
    stdenv = pkgs.clangStdenv;
}