Closed zerog2k closed 5 years ago
ok appears that LINKFLAGS getting passed to link stage, but CFLAGS not passed to compile stage?
@ivankravets @Palatis any pointers here? https://github.com/platformio/platform-mcs51/blob/master/builder/main.py#L71-L103
sorry, to be clear, my post_extra_script.py is doing this:
# compiler and linker flags dont work very well in build_flags of platformio.ini - need to set them here
env.Append(
CFLAGS = [
"--disable-warning", 126,
"--disable-warning", 59
],
LINKFLAGS = [
"--data-loc", 0x30
]
)
I've just renamed dev platform and refactored code. Please run pio update
.
Next. Please use pre:extra.py
instead of POST.
Does it work now?
Could you provide "blink" project here and attach? I would like to test it on my Mac and add CI support.
here is a simply "blinky" project... just updated so it will build against latest https://github.com/zerog2k/stc_blinky
regarding extra_script, i changed the line to:
extra_scripts = pre:extra_script.py
and renamed post_extra_script.py to extra_script.py - is this correct? (did not change - still getting warnings, seems like not including)
for my own and others' ref, seems like many changes and additions to this doc since last time I looked at this... need to re-read: http://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#projectconf-advanced-scripting
Are these flags https://github.com/platformio/platform-intel_mcs51/issues/11#issuecomment-412130947 common per each board? Could we add them directly to dev platform?
no, this is some cflags specific to this board...
i'd prefer to put into simpler build_flags
, but there seems to be some disconnect in the way options are passed from platformio to compiler...
e.g.
build_flags = "--option value"
gets interpreted as a single option, not option name "option" then value of "value". Anyhow, I think Palatis pointed this out last time as well.. The previous workaround was to hack on the CFLAGS var with a strange list construct, not sure why it was needed, but now it seems broken. Anyhow, I found a completely different workaround, which is to use sdcc compiler pragmas in the sourc code to disable certain warnings. Since this is project specific, this will work for me, and I can take it out of extra scripts... (Although still curious why it just didnt work... ;)
Tested with
[env:myenv]
build_flags =
--data-loc 0x30
--disable-warning 126
--disable-warning 59
P.S: If you need to pass something to LINKFLAGS, you have to use extra script.
There are some more advanced things im trying to do with my project which don't seem to be working E.g., for one of my projects, I have some very special (don't ask why ;) CFLAGS and LINKFLAGS, which I'm not sure how to handle other than appending to env in extra_script.py: https://github.com/zerog2k/stc_diyclock/blob/master/post_extra_script.py#L12-L20 I think it used to work, but now testing, I'm compiling and seeing that these don't seem to be honored by compile time.