mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 02:27:13 +02:00
Fixed an issue with preprocessing of `*.ino
` when macros were not handled // Resolve #2972
This commit is contained in:
@ -12,6 +12,7 @@ PlatformIO Core 4.0
|
|||||||
* Extend project environment configuration in "platformio.ini" with other sections using a new `extends <http://docs.platformio.org/page/projectconf/section_env_advanced.html#extends>`__ option (`issue #2953 <https://github.com/platformio/platformio-core/issues/2953>`_)
|
* Extend project environment configuration in "platformio.ini" with other sections using a new `extends <http://docs.platformio.org/page/projectconf/section_env_advanced.html#extends>`__ option (`issue #2953 <https://github.com/platformio/platformio-core/issues/2953>`_)
|
||||||
* Fixed an issue with project generator for `CLion IDE <http://docs.platformio.org/page/ide/clion.html>`__ when 2 environments were used (`issue #2824 <https://github.com/platformio/platformio-core/issues/2824>`_)
|
* Fixed an issue with project generator for `CLion IDE <http://docs.platformio.org/page/ide/clion.html>`__ when 2 environments were used (`issue #2824 <https://github.com/platformio/platformio-core/issues/2824>`_)
|
||||||
* Fixed default PIO Unified Debugger configuration for `J-Link probe <http://docs.platformio.org/en/latest/plus/debug-tools/jlink.html>`__
|
* Fixed default PIO Unified Debugger configuration for `J-Link probe <http://docs.platformio.org/en/latest/plus/debug-tools/jlink.html>`__
|
||||||
|
* Fixed an issue with preprocessing of ``*.ino`` files when macros were not handled (`issue #2972 <https://github.com/platformio/platformio-core/issues/2972>`_)
|
||||||
|
|
||||||
4.0.3 (2019-08-30)
|
4.0.3 (2019-08-30)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -816,15 +816,21 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
|||||||
|
|
||||||
def get_search_files(self):
|
def get_search_files(self):
|
||||||
# project files
|
# project files
|
||||||
items = LibBuilderBase.get_search_files(self)
|
search_files = LibBuilderBase.get_search_files(self)
|
||||||
# test files
|
# test files
|
||||||
if "__test" in COMMAND_LINE_TARGETS:
|
if "__test" in COMMAND_LINE_TARGETS:
|
||||||
items.extend([
|
search_files.extend([
|
||||||
join("$PROJECTTEST_DIR",
|
join("$PROJECTTEST_DIR",
|
||||||
item) for item in self.env.MatchSourceFiles(
|
item) for item in self.env.MatchSourceFiles(
|
||||||
"$PROJECTTEST_DIR", "$PIOTEST_SRC_FILTER")
|
"$PROJECTTEST_DIR", "$PIOTEST_SRC_FILTER")
|
||||||
])
|
])
|
||||||
return items
|
if "arduino" in self.env.get("PIOFRAMEWORK", []):
|
||||||
|
search_files.extend([
|
||||||
|
join(self.src_dir, item)
|
||||||
|
for item in fs.match_src_files(self.src_dir, self.src_filter, (
|
||||||
|
"ino", "pde"))
|
||||||
|
])
|
||||||
|
return search_files
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lib_ldf_mode(self):
|
def lib_ldf_mode(self):
|
||||||
|
@ -88,11 +88,13 @@ class InoToCPPConverter(object):
|
|||||||
tmp_path = mkstemp()[1]
|
tmp_path = mkstemp()[1]
|
||||||
with open(tmp_path, "w") as fp:
|
with open(tmp_path, "w") as fp:
|
||||||
fp.write(contents)
|
fp.write(contents)
|
||||||
self.env.Execute(
|
env = self.env.Clone()
|
||||||
self.env.VerboseAction(
|
env.Append(CCFLAGS=["-x", "c++", "-E"])
|
||||||
'$CXX -o "{0}" -x c++ -fpreprocessed -dD -E "{1}"'.format(
|
cmd = env["CXXCOM"]\
|
||||||
out_file, tmp_path),
|
.replace("$TARGET", '"%s"' % out_file)\
|
||||||
"Converting " + basename(out_file[:-4])))
|
.replace("$SOURCES", '"%s"' % tmp_path)
|
||||||
|
env.Execute(
|
||||||
|
env.VerboseAction(cmd, "Converting " + basename(out_file[:-4])))
|
||||||
atexit.register(_delete_file, tmp_path)
|
atexit.register(_delete_file, tmp_path)
|
||||||
return isfile(out_file)
|
return isfile(out_file)
|
||||||
|
|
||||||
|
@ -63,6 +63,10 @@ def _build_project_deps(env):
|
|||||||
# extra build flags from `platformio.ini`
|
# extra build flags from `platformio.ini`
|
||||||
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
||||||
|
|
||||||
|
if ("nobuild" not in COMMAND_LINE_TARGETS
|
||||||
|
and "arduino" in projenv.get("PIOFRAMEWORK", [])):
|
||||||
|
projenv.ConvertInoToCpp()
|
||||||
|
|
||||||
is_test = "__test" in COMMAND_LINE_TARGETS
|
is_test = "__test" in COMMAND_LINE_TARGETS
|
||||||
if is_test:
|
if is_test:
|
||||||
projenv.BuildSources("$BUILDTEST_DIR", "$PROJECTTEST_DIR",
|
projenv.BuildSources("$BUILDTEST_DIR", "$PROJECTTEST_DIR",
|
||||||
@ -284,8 +288,6 @@ def BuildFrameworks(env, frameworks):
|
|||||||
if f == "arduino":
|
if f == "arduino":
|
||||||
# Arduino IDE appends .o the end of filename
|
# Arduino IDE appends .o the end of filename
|
||||||
Builder.match_splitext = scons_patched_match_splitext
|
Builder.match_splitext = scons_patched_match_splitext
|
||||||
if "nobuild" not in COMMAND_LINE_TARGETS:
|
|
||||||
env.ConvertInoToCpp()
|
|
||||||
|
|
||||||
if f in board_frameworks:
|
if f in board_frameworks:
|
||||||
SConscript(env.GetFrameworkScript(f), exports="env")
|
SConscript(env.GetFrameworkScript(f), exports="env")
|
||||||
|
Reference in New Issue
Block a user