diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py index 236c2eaa037b..fc7202204992 100644 --- a/lib/python/qmk/build_targets.py +++ b/lib/python/qmk/build_targets.py @@ -10,7 +10,6 @@ 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 -from qmk.cli.generate.compilation_database import write_compilation_database class BuildTarget: @@ -105,6 +104,7 @@ def compile_command(self, build_target: str = None, dry_run: bool = False, **env def generate_compilation_database(self, build_target: str = None, skip_clean: bool = False, **env_vars) -> None: 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) def compile(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: