Skip to content

Commit

Permalink
Merge pull request snabbco#189 from lukego/nix-build-options
Browse files Browse the repository at this point in the history
default.nix: Test with -DLUA_USE_ASSERT and -Werror
  • Loading branch information
lukego authored Aug 14, 2018
2 parents 52e2977 + d3c149d commit 2a7990a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
let
callPackage = (pkgs.lib.callPackageWith { inherit pkgs source version; });
raptorjit = (callPackage ./raptorjit.nix {});
test = name: args: (callPackage ./test.nix { inherit raptorjit name args; });
raptorjit-assert = raptorjit.overrideAttrs(
old: { NIX_CFLAGS_COMPILE = " -DLUA_USE_ASSERT"; });
test = name: args: (callPackage ./test.nix { inherit name args; raptorjit = raptorjit-assert; });
check-generated-code = (callPackage ./check-generated-code.nix { inherit raptorjit; });
nowarnings = raptorjit.overrideAttrs(
old: { NIX_CFLAGS_COMPILE = "-Werror"; });
in

# Build RaptorJIT and run mulitple test suites.
Expand All @@ -27,5 +31,5 @@ in
test-O1 = test "O1" "-O1";
test-nojit = test "nojit" "-joff";
} //
(if check then { inherit check-generated-code; } else {})
(if check then { inherit nowarnings check-generated-code; } else {})

2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NODOTABIVER= 51
# to slow down the C part by not omitting it. Debugging, tracebacks and
# unwinding are not affected -- the assembler part has frame unwind
# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
CCOPT= -O2 -fomit-frame-pointer -Werror
CCOPT= -O2 -fomit-frame-pointer
# Use this if you want to generate a smaller binary (but it's slower):
#CCOPT= -Os -fomit-frame-pointer
# Note: it's no longer recommended to use -O3 with GCC 4.x.
Expand Down

0 comments on commit 2a7990a

Please sign in to comment.