platformio / platform-native

Native: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/native
Apache License 2.0
21 stars 27 forks source link

Setting CXX flags from extra_script.py doesn't work #3

Closed KKoovalsky closed 4 years ago

KKoovalsky commented 4 years ago

I was able to normally build pio test -e native around two-three months ago on version 4.3.2a1.

Then I went back to my project and tried to run the native tests with the same setup, but with no luck. The version I have currently is 4.3.4a2.

Inside extra_script.py:

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

    Both 1. and 2. don'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

valeros commented 4 years ago

Please update native platform by running pio update command and try again. Thanks!