Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes debug flag when compiling in debug mode #3646

Merged
merged 1 commit into from Dec 7, 2016
Merged

Includes debug flag when compiling in debug mode #3646

merged 1 commit into from Dec 7, 2016

Conversation

luislavena
Copy link
Contributor

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 %}

Cheers.

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 %}
@luislavena
Copy link
Contributor Author

Hello,

I've also changed the usage of the flags from instance variables to use defined properties (@release vs release?) to be more consistent with others like wants_docs?. Applied the same style to the debug? check.

Thank you.

@asterite
Copy link
Member

asterite commented Dec 7, 2016

This is useful, thank you! 💚

@asterite asterite merged commit 988005c into crystal-lang:master Dec 7, 2016
@asterite asterite added this to the 0.20.2 milestone Dec 7, 2016
@luislavena luislavena deleted the add-debug-to-flags branch December 7, 2016 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants