question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting CXX flags from extra_script.py doesn't work

See original GitHub issue

I followed the split C/C++ build flags instructions in order to use the -fpermissive flag when compiling .cpp files (-fpermissive is not valid for C).

I created a extra_script.py file containing env.Append(CXXFLAGS=["-fpermissive"]) and added extra_scripts = extra_script.py to platformio.ini. However, the flag is not used when building .cpp files (I have a src folder with only main.cpp).

I did not test whether this issue is specifically related the espressif32 platform but most likely this is due to the ESP-IDF CMake build system of this platform.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
valeroscommented, May 6, 2020

Hi @KKoovalsky ! Looks like you’re having a problem with native platform. Please open an issue in this repository https://github.com/platformio/platform-native/issues Thanks!

1reaction
KKoovalskycommented, May 6, 2020

It actually doesn’t work. With:

env.Append(
    CXXFLAGS=[
        '-Wall',
        '-Wextra',
        '-std=gnu++17',
        '-Wno-register'
    ]
)
  1. Tried:
[env]
extra_scripts = pre:extra_script.py
  1. Tried:
[env:native]
extra_scripts = pre:extra_script.py

Both doesn’t work, but when I change CXXFLAGS to CPPFLAGS the flags are used BUT, both for g++ and gcc.

See the attached logs:

cppflags_defined.log cxxflags_defined.log

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with adding additional CFLAGS path #29968 - GitHub
I would like to know why adding additional include paths via CFLAGS doesn't work for building Pytorch? I haven't root access to install ......
Read more >
CFLAGS and gcc at configure not passed in makefile
I'm using "Python 3.2.1 bzipped source tarball" on Linux and it works for me (tm). · Which version of Python is this? Your...
Read more >
Issue 9189: Improve CFLAGS handling - Python tracker
Since the user's CFLAGS settings are overridden by Python's OPT settings, it doesn't already work without the patch.
Read more >
What is the correct syntax to add CFLAGS and LDFLAGS to ...
The correct way is: ./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib". but this may not work with all configure scripts.
Read more >
Setting environ['CFLAGS'] in a distutils setup.py file results in ...
This works in the python 2.4 supplied with RHEL5. There is a regression in RHEL6. When the user specifies CFLAGS like this, some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found