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

allow #defines to be passed to the compilation process (aka -D option on GCC) #21

Open
markthepiggy opened this issue Oct 1, 2014 · 2 comments

Comments

@markthepiggy
Copy link

I don't know if this can be done already but I haven't found a way.

I #define TESTING (for instance). If I want to change this, i have to remember to do it in every file. GCC lets me do this with the -D flag...

-D name
or
-D name=definition

Is there any way you can fix things to pass #defines through to the compiler?

@eried
Copy link
Owner

eried commented Oct 8, 2014

Why you don't define that in the sketch itself?

@Chris--A
Copy link

Consider libraries.

Serial Rx/Tx buffer sizes, pulseIn max pulse width (anything that is compiled before the sketch needs this).

I personally would like each sketch to have the ability to define a platform.txt with compiler.cpp.flags and compiler.c.flags

Then sketches can then default C++98 or C++11, change compiler options easy (not just adding defines). And possibly the addition of a default board/port which others have asked for.

I don't know how I got here, and only just realized, so I'm going to post anyway! But it is what I want for the original/upstream IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants