Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: compiler.cpp.extra_flags not working

  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    5

    compiler.cpp.extra_flags not working

    Hello,

    As I explained in my second message in that thread:
    https://forum.pjrc.com/threads/53937...MY_FLAG-1-quot

    hardware/teensy/avr/platform.txt doesn't use compiler.cpp.extra_flags. Would it be possible to add compiler.cpp.extra_flags in platform.txt?

    I'm not very familiar with teensy. I'm not sure if it is opensource on the software part. And if it is, I'm not sure where it is. If it is open source, I would be more than happy to suggest a patch to solve that problem.

    compiler.cpp.extra_flags is useful to compile my project using the command line (arduino-builder) and set a flag value on the fly that can be used while compiling my project (using macros).

    Thanks,

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,905
    The Teensyduino core files are definitively open source as you can see in almost every single source file. They are in a public repository on github, so you might fork it, create a patch, and issue a pull request. But you have to understand that an estimated 99% of Teensy users does not invoke the arduino-builder manually and might thus not be interested in your idea, especially since a simple single #define on top of the .ino file can lead basically to a similar result.

  3. #3
    Junior Member
    Join Date
    Oct 2018
    Posts
    5
    I understand that not a lot of people use that feature. But since it works with other arduino hardware, and it is a feature supported by Arduino IDE, it would be nice to have it on teensy too (at least I would be happy ).
    And since it is not a high demand, that's why I would be happy to suggest a patch.

    I've seen https://github.com/PaulStoffregen. But I found 213 repositories... I'm a bit lost there.

    In which repository can I fix hardware/teensy/avr/platform.txt ?

    Thanks for the fast answer!

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,359
    The boards.txt and platform.txt files aren't on github. That's not because they're meant to be closed source. The reason has to do with the special build scripts (which are closed source) I use for creating the installers. Those files need to be customized for the different supported Arduino versions, so there isn't one definitive copy to have on the github repository.

    Regarding this:

    Would it be possible to add compiler.cpp.extra_flags in platform.txt?
    Certainly you can edit the copy of boards.txt on your machine. If using a Mac, control-click Arduino and "Show Package Contents" to access the files inside the application bundle. On Linux and Windows the Arduino software is ordinary directories.

    Whether I'll change platform.txt for Teensyduino 1.45 remains to be seen. Right now, I'm leaning towards "probably not". But if a really compelling use case is made here, I might consider it....

  5. #5
    Junior Member
    Join Date
    Oct 2018
    Posts
    5
    Thanks for the suggestion, but I came here to avoid exactly that solution. I don't want to patch that file every time I would like to update a version.

    Thanks for your answer. I guess I have to move on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •