Fixed an issue on Windows OS when flags were wrapped to the temporary file while generating compilation database

This commit is contained in:
Ivan Kravets
2022-06-20 14:49:39 +03:00
parent 5142feba7a
commit 9ae67fdad9
3 changed files with 7 additions and 3 deletions

View File

@ -37,6 +37,7 @@ PlatformIO Core 6
* Improved a serial port finder for a board with predefined HWIDs
* Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ operation ignores a flag value (`issue #4309 <https://github.com/platformio/platformio-core/issues/4309>`_)
* Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ option was not applied to the ``ASPPFLAGS`` scope
* Fixed an issue on Windows OS when flags were wrapped to the temporary file while generating the `Compilation database "compile_commands.json" <https://docs.platformio.org/en/latest/integration/compile_commands.html>`__
6.0.2 (2022-06-01)
~~~~~~~~~~~~~~~~~~

View File

@ -59,13 +59,13 @@ DEFAULT_ENV_OPTIONS = dict(
"pioplatform",
"piotest",
"piotarget",
"piomaxlen",
"piolib",
"pioupload",
"piosize",
"pioino",
"piomisc",
"piointegration",
"piomaxlen",
],
toolpath=[os.path.join(fs.get_source_dir(), "builder", "tools")],
variables=clivars,

View File

@ -19,6 +19,7 @@ import os
import re
from SCons.Platform import TempFileMunge # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from SCons.Subst import quote_spaces # pylint: disable=import-error
from platformio.compat import IS_WINDOWS, hashlib_encode_data
@ -70,11 +71,13 @@ def _file_long_data(env, data):
return tmp_file
def exists(_):
return True
def exists(env):
return "compiledb" not in COMMAND_LINE_TARGETS and not env.IsIntegrationDump()
def generate(env):
if not exists(env):
return env
kwargs = dict(
_long_sources_hook=long_sources_hook,
TEMPFILE=TempFileMunge,