Skip to content

Commit

Permalink
Add enableDebug option to all derivations
Browse files Browse the repository at this point in the history
  • Loading branch information
aleasims committed Jun 3, 2024
1 parent 748620c commit 4eac200
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
8 changes: 3 additions & 5 deletions nix/evmc/evmc.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, stdenv, fetchFromGitHub }:
{ pkgs, stdenv, fetchFromGitHub, enableDebug ? true }:

stdenv.mkDerivation rec {
name = "evmc";
Expand All @@ -12,10 +12,8 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgs.cmake ];

cmakeFlags = [
"-DEVMC_TOOLS=FALSE"
];
cmakeBuildType = if enableDebug then "Debug" else "Release";

doCheck = true;
dontStrip = true;
dontStrip = enableDebug;
}
3 changes: 2 additions & 1 deletion nix/hashtree/hashtree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, fetchFromGitHub
, fetchpatch
, automake
, enableDebug ? false
}:

let
Expand All @@ -29,7 +30,7 @@ stdenv.mkDerivation rec {
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-no-integrated-as -std=c2x";

doCheck = true;
dontStrip = true;
dontStrip = enableDebug;

nativeBuildInputs = [
automake
Expand Down
4 changes: 3 additions & 1 deletion nix/intx/intx.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, pkgs }:
{ lib, stdenv, fetchFromGitHub, pkgs, enableDebug ? false }:

stdenv.mkDerivation rec {
name = "intx";
Expand All @@ -13,5 +13,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgs.cmake ];

cmakeBuildType = if enableDebug then "Debug" else "Release";

cmakeFlags = [ "-DINTX_TESTING=OFF" ];
}
8 changes: 5 additions & 3 deletions nix/sszpp/sszpp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, cmake
, intx
, hashtree
, enableDebug ? false
}:

let
Expand All @@ -24,13 +25,14 @@ stdenv.mkDerivation rec {
outputs = [ "out" ];

doCheck = true;
dontStrip = true;
env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security -Wno-defaulted-function-deleted -Wno-unneeded-internal-declaration -Wno-logical-op-parentheses";

cmakeFlags = [
"-DCMAKE_CXX_STANDARD=23"
];

cmakeBuildType = if enableDebug then "Debug" else "Release";

patches = [
./sszpp-merkleize-remove.patch
];
Expand All @@ -40,8 +42,8 @@ stdenv.mkDerivation rec {
];

propagatedBuildInputs = [
intx
hashtree
(intx.override { inherit enableDebug; })
(hashtree.override { inherit enableDebug; })
];

meta = with lib; {
Expand Down

0 comments on commit 4eac200

Please sign in to comment.