aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/build_targets.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/build_targets.py')
-rw-r--r--lib/python/qmk/build_targets.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py
index e2df029490..35a5f89f91 100644
--- a/lib/python/qmk/build_targets.py
+++ b/lib/python/qmk/build_targets.py
@@ -11,7 +11,8 @@ from qmk.commands import find_make, get_make_parallel_args, parse_configurator_j
from qmk.keyboard import keyboard_folder
from qmk.info import keymap_json
from qmk.keymap import locate_keymap
-from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace
+from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace, unix_style_path
+from qmk.compilation_database import write_compilation_database
# These must be kept in the order in which they're applied to $(TARGET) in the makefiles in order to ensure consistency.
TARGET_FILENAME_MODIFIERS = ['FORCE_LAYOUT', 'CONVERT_TO']
@@ -150,7 +151,6 @@ class BuildTarget:
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
output_path = QMK_FIRMWARE / 'compile_commands.json'
ret = write_compilation_database(command=command, output_path=output_path, skip_clean=skip_clean, **env_vars)
if ret and output_path.exists() and HAS_QMK_USERSPACE:
@@ -204,11 +204,11 @@ class KeyboardKeymapBuildTarget(BuildTarget):
if is_under_qmk_userspace(keymap_location) and not is_under_qmk_firmware(keymap_location):
keymap_directory = keymap_location.parent
compile_args.extend([
- f'MAIN_KEYMAP_PATH_1={keymap_directory}',
- f'MAIN_KEYMAP_PATH_2={keymap_directory}',
- f'MAIN_KEYMAP_PATH_3={keymap_directory}',
- f'MAIN_KEYMAP_PATH_4={keymap_directory}',
- f'MAIN_KEYMAP_PATH_5={keymap_directory}',
+ f'MAIN_KEYMAP_PATH_1={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_2={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_3={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_4={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_5={unix_style_path(keymap_directory)}',
])
return compile_args
@@ -267,11 +267,11 @@ class JsonKeymapBuildTarget(BuildTarget):
generated_files_path = intermediate_output / 'src'
keymap_json = generated_files_path / 'keymap.json'
compile_args.extend([
- f'MAIN_KEYMAP_PATH_1={intermediate_output}',
- f'MAIN_KEYMAP_PATH_2={intermediate_output}',
- f'MAIN_KEYMAP_PATH_3={intermediate_output}',
- f'MAIN_KEYMAP_PATH_4={intermediate_output}',
- f'MAIN_KEYMAP_PATH_5={intermediate_output}',
+ f'MAIN_KEYMAP_PATH_1={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_2={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_3={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_4={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_5={unix_style_path(intermediate_output)}',
f'KEYMAP_JSON={keymap_json}',
f'KEYMAP_PATH={generated_files_path}',
])