diff options
author | QMK Bot <[email protected]> | 2024-01-19 21:12:23 +0000 |
---|---|---|
committer | QMK Bot <[email protected]> | 2024-01-19 21:12:23 +0000 |
commit | a9e9a533aa23aec99925ecc2e34537f094243ee4 (patch) | |
tree | 18bf78e0c45581c566464c917b46396b784e8732 | |
parent | f6a70e45c243112b8bc201c216539320ac342b9f (diff) | |
parent | 62d19fc2ac42b39a4f32683c7e8c5ad95b566b24 (diff) | |
download | qmk_firmware-a9e9a533aa23aec99925ecc2e34537f094243ee4.tar.gz qmk_firmware-a9e9a533aa23aec99925ecc2e34537f094243ee4.zip |
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r-- | lib/python/qmk/build_targets.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py index 1ab489cec3..80f587bcc0 100644 --- a/lib/python/qmk/build_targets.py +++ b/lib/python/qmk/build_targets.py @@ -6,7 +6,7 @@ from typing import List, Union from pathlib import Path from dotty_dict import dotty, Dotty from milc import cli -from qmk.constants import QMK_FIRMWARE, INTERMEDIATE_OUTPUT_PREFIX +from qmk.constants import QMK_FIRMWARE, INTERMEDIATE_OUTPUT_PREFIX, HAS_QMK_USERSPACE, QMK_USERSPACE from qmk.commands import find_make, get_make_parallel_args, parse_configurator_json from qmk.keyboard import keyboard_folder from qmk.info import keymap_json @@ -118,7 +118,10 @@ class BuildTarget: self.prepare_build(build_target=build_target, **env_vars) command = self.compile_command(build_target=build_target, dry_run=True, **env_vars) from qmk.cli.generate.compilation_database import write_compilation_database # Lazy load due to circular references - write_compilation_database(command=command, output_path=QMK_FIRMWARE / 'compile_commands.json', skip_clean=skip_clean, **env_vars) + output_path = QMK_FIRMWARE / 'compile_commands.json' + write_compilation_database(command=command, output_path=output_path, skip_clean=skip_clean, **env_vars) + if output_path.exists() and HAS_QMK_USERSPACE: + shutil.copy(str(output_path), str(QMK_USERSPACE / 'compile_commands.json')) def compile(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: if self._clean or self._compiledb: |