-
Notifications
You must be signed in to change notification settings - Fork 68
[native_toolchain_c] Add support for configuring preprocessor macro defines #120
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also bump the version number in pubspec.yaml to 0.2.1-wip.0
(or 0.2.1
if you'd like a release right away) and add an entry to the CHANGELOG.md
Thanks @blaugold !
|
||
/// Whether to define a macro for the current [BuildMode]. | ||
/// | ||
/// The macro name is the uppercase name of the build mode and does not have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: I found this in some build systems to be the default, but I didn't add documentation here. 🙄
pkgs/native_toolchain_c/test/cbuilder/testfiles/defines/src/defines.c
Outdated
Show resolved
Hide resolved
Sorry about the many CI runs. 🙈 😅 The changelog/version validation step complained that the versions don't agree, even though they did, so I've removed |
It should work, But I'm fine with merging this and just publishing |
@mosuem Did we opt all repositories in to using |
Should be resolved with dart-lang/ecosystem#162 I hope? |
@mosuem has that been published yet? I've rerun the job, but it fails with the same error. |
98176a9
to
5ea96be
Compare
The reruns always use the commit before the fix in
I've pushed a new commit, maybe that helps. |
Thanks @blaugold ! 🚀 |
This PR adds
CBuilder.defines
which can be used to specify definitions for preprocessor macros. Providing a value for a macro is optional.Whether a macro with the name of the current
BuildMode
is defined is now configurable throughCBuilder.buildModeDefine
. Per default, this option is enabled.Additionally, the standard
NDEBUG
macro is now being defined when not building withBuildMode.debug
. This behavior is also configurable (CBuilder.ndebugDefine
) and enabled by default.Closes #61