mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Improve docs for "build_flags"
This commit is contained in:
2
docs
2
docs
Submodule docs updated: 437b1175bd...890d8e20fe
@ -200,7 +200,7 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
|
|||||||
# fix relative CPPPATH & LIBPATH
|
# fix relative CPPPATH & LIBPATH
|
||||||
for k in ("CPPPATH", "LIBPATH"):
|
for k in ("CPPPATH", "LIBPATH"):
|
||||||
for i, p in enumerate(result.get(k, [])):
|
for i, p in enumerate(result.get(k, [])):
|
||||||
if os.path.isdir(p):
|
if not os.path.isabs(p):
|
||||||
result[k][i] = os.path.abspath(p)
|
result[k][i] = os.path.abspath(p)
|
||||||
|
|
||||||
# fix relative path for "-include"
|
# fix relative path for "-include"
|
||||||
|
@ -134,7 +134,7 @@ class ProjectGenerator:
|
|||||||
for root, _, files in os.walk(self.config.get("platformio", "src_dir")):
|
for root, _, files in os.walk(self.config.get("platformio", "src_dir")):
|
||||||
for f in files:
|
for f in files:
|
||||||
result.append(
|
result.append(
|
||||||
os.path.relpath(os.path.join(os.path.realpath(root), f))
|
os.path.relpath(os.path.join(os.path.abspath(root), f))
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ def test_generic_build(clirunner, validate_cliresult, tmpdir):
|
|||||||
("-D TEST_INT=13", "-DTEST_INT=13"),
|
("-D TEST_INT=13", "-DTEST_INT=13"),
|
||||||
("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"),
|
("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"),
|
||||||
('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"'),
|
('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"'),
|
||||||
|
("-Iextra_inc", "-Iextra_inc"),
|
||||||
]
|
]
|
||||||
|
|
||||||
tmpdir.join("platformio.ini").write(
|
tmpdir.join("platformio.ini").write(
|
||||||
@ -58,8 +59,20 @@ projenv.Append(CPPDEFINES="POST_SCRIPT_MACRO")
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tmpdir.mkdir("extra_inc").join("foo.h").write(
|
||||||
|
"""
|
||||||
|
#define FOO
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
tmpdir.mkdir("src").join("main.cpp").write(
|
tmpdir.mkdir("src").join("main.cpp").write(
|
||||||
"""
|
"""
|
||||||
|
#include "foo.h"
|
||||||
|
|
||||||
|
#ifndef FOO
|
||||||
|
#error "FOO"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef I_AM_ONLY_SRC_FLAG
|
#ifdef I_AM_ONLY_SRC_FLAG
|
||||||
#include <component.h>
|
#include <component.h>
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user