debug vs release

673 views
Skip to first unread message

Thiago Farina

unread,
Oct 23, 2015, 9:08:21 PM10/23/15
to ninja...@googlegroups.com
To have different sets of compilations flags depending whether you are doing a local debug build versus doing a release build for public consumption, is the following (two separate build files in two different directories) the best approach?

$ cat out/Debug/build.ninja
cc = clang
cflags = -g

rule compile
  command = $cc $cflags -c $in -o $out

$ ninja -C out/Debug

$ cat out/Release/build.ninja
cc = clang
cflags = -g0 -O2
defines = -DNDEBUG

rule compile
  command = $cc $cflags $defines -c $in -o $out

$ ninja -C out/Release

--
Thiago Farina

Evan Martin

unread,
Oct 25, 2015, 5:20:43 PM10/25/15
to Thiago Farina, ninja...@googlegroups.com
That works. Or you can use a single directory and regenerate your
build.ninja when you change flags.
> --
> You received this message because you are subscribed to the Google Groups
> "ninja-build" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ninja-build...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages