Skip to content

Commit

Permalink
Includes debug flag when compiling in debug mode
Browse files Browse the repository at this point in the history
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 %}
  • Loading branch information
luislavena authored and asterite committed Dec 7, 2016
1 parent 284f7d6 commit 988005c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/crystal/compiler.cr
Expand Up @@ -151,7 +151,8 @@ module Crystal
program = Program.new
program.cache_dir = CacheDir.instance.directory_for(sources)
program.target_machine = target_machine
program.flags << "release" if @release
program.flags << "release" if release?
program.flags << "debug" if debug?
program.flags.merge! @flags
program.wants_doc = wants_doc?
program.color = color?
Expand Down

0 comments on commit 988005c

Please sign in to comment.