Skip to content

Commit 988005c

Browse files
luislavenaAry Borenszweig
authored and
Ary Borenszweig
committedDec 7, 2016
Includes debug flag when compiling in debug mode
Allow usage of `flag?(:debug)` in macros for builds been done with `--debug` option. This pairs with `--release` and `flag?(:release)` usage in similar way to allow include or exclude code from the compilation process. {% if flag?(:debug) %} # debug-only code {% end %}
1 parent 284f7d6 commit 988005c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/compiler/crystal/compiler.cr

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ module Crystal
151151
program = Program.new
152152
program.cache_dir = CacheDir.instance.directory_for(sources)
153153
program.target_machine = target_machine
154-
program.flags << "release" if @release
154+
program.flags << "release" if release?
155+
program.flags << "debug" if debug?
155156
program.flags.merge! @flags
156157
program.wants_doc = wants_doc?
157158
program.color = color?

0 commit comments

Comments
 (0)
Please sign in to comment.