Commit 00aab451 authored by Guillaume Maudoux's avatar Guillaume Maudoux
Browse files

mozart: Simplify build thanks to the new sources format

parent acd90cdb
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
, boost169
, pinnedBoost ? boost169
, llvmPackages
, llvmPackages_8
, gmp
, emacs
, jre_headless
@@ -42,23 +41,9 @@ in stdenv.mkDerivation rec {

  nativeBuildInputs = [ cmake makeWrapper unzip ];

  # We cannot compile with both gcc and clang, but we need clang during the
  # process, so we compile everything with clang.
  # BUT, we need clang4 for parsing, and a more recent clang for compiling.
  cmakeFlags = [
    "-DCMAKE_CXX_COMPILER=${llvmPackages.clang}/bin/clang++"
    "-DCMAKE_C_COMPILER=${llvmPackages.clang}/bin/clang"
    "-DBoost_USE_STATIC_LIBS=OFF"
    "-DMOZART_BOOST_USE_STATIC_LIBS=OFF"
    "-DCMAKE_PROGRAM_PATH=${llvmPackages_8.clang}/bin"
    # Rationale: Nix's cc-wrapper needs to see a compile flag (like -c) to
    # infer that it is not a linking call, and stop trashing the command line
    # with linker flags.
    # As it does not recognise -emit-ast, we pass -c immediately overridden
    # by -emit-ast.
    # The remaining is just the default flags that we cannot reuse and need
    # to repeat here.
    "-DMOZART_GENERATOR_FLAGS='-c;-emit-ast;--std=c++0x;-Wno-invalid-noreturn;-Wno-return-type;-Wno-braced-scalar-init'"
    # We are building with clang, as nix does not support having clang and
    # gcc together as compilers and we need clang for the sources generation.
    # However, clang emits tons of warnings about gcc's atomic-base library.
@@ -71,9 +56,6 @@ in stdenv.mkDerivation rec {

  buildInputs = [
    pinnedBoost
    llvmPackages_8.llvm
    llvmPackages_8.clang
    llvmPackages_8.clang-unwrapped
    gmp
    emacs
    jre_headless