build: only exclude debug symbols on m1

This commit is contained in:
Jōshin 2022-01-25 08:42:14 -08:00
parent ba1d5024a8
commit da2b62fcf5
No known key found for this signature in database
GPG Key ID: A8BE5A9A521639D0

View File

@ -14,6 +14,12 @@ let
version = builtins.readFile "${src}/version";
# See https://github.com/urbit/urbit/issues/5561
oFlags =
if stdenv.hostPlatform.system == "aarch64-darwin"
then (if enableDebug then [ "-O0" "-g" ] else [ "-O3" ])
else [ (if enableDebug then "-O0" else "-O3") "-g" ];
in stdenv.mkDerivation {
inherit src version;
@ -59,8 +65,7 @@ in stdenv.mkDerivation {
then [ "--disable-shared" "--enable-static" ]
else [];
CFLAGS = (if enableDebug then [ "-O0" "-g" ] else [ "-O3" ])
++ lib.optionals (!enableDebug) [ "-Werror" ];
CFLAGS = oFlags ++ lib.optionals (!enableDebug) [ "-Werror" ];
MEMORY_DEBUG = enableDebug;
CPU_DEBUG = enableDebug;