Skip to content

Commit 575abc4

Browse files
authored
More Windows->Unix style path fixes. (#25119)
1 parent 0ec96dd commit 575abc4

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

lib/python/qmk/build_targets.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from qmk.keyboard import keyboard_folder
1212
from qmk.info import keymap_json
1313
from qmk.keymap import locate_keymap
14-
from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace
14+
from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace, unix_style_path
1515

1616
# These must be kept in the order in which they're applied to $(TARGET) in the makefiles in order to ensure consistency.
1717
TARGET_FILENAME_MODIFIERS = ['FORCE_LAYOUT', 'CONVERT_TO']
@@ -204,11 +204,11 @@ def compile_command(self, build_target: str = None, dry_run: bool = False, **env
204204
if is_under_qmk_userspace(keymap_location) and not is_under_qmk_firmware(keymap_location):
205205
keymap_directory = keymap_location.parent
206206
compile_args.extend([
207-
f'MAIN_KEYMAP_PATH_1={keymap_directory}',
208-
f'MAIN_KEYMAP_PATH_2={keymap_directory}',
209-
f'MAIN_KEYMAP_PATH_3={keymap_directory}',
210-
f'MAIN_KEYMAP_PATH_4={keymap_directory}',
211-
f'MAIN_KEYMAP_PATH_5={keymap_directory}',
207+
f'MAIN_KEYMAP_PATH_1={unix_style_path(keymap_directory)}',
208+
f'MAIN_KEYMAP_PATH_2={unix_style_path(keymap_directory)}',
209+
f'MAIN_KEYMAP_PATH_3={unix_style_path(keymap_directory)}',
210+
f'MAIN_KEYMAP_PATH_4={unix_style_path(keymap_directory)}',
211+
f'MAIN_KEYMAP_PATH_5={unix_style_path(keymap_directory)}',
212212
])
213213

214214
return compile_args
@@ -267,11 +267,11 @@ def compile_command(self, build_target: str = None, dry_run: bool = False, **env
267267
generated_files_path = intermediate_output / 'src'
268268
keymap_json = generated_files_path / 'keymap.json'
269269
compile_args.extend([
270-
f'MAIN_KEYMAP_PATH_1={intermediate_output}',
271-
f'MAIN_KEYMAP_PATH_2={intermediate_output}',
272-
f'MAIN_KEYMAP_PATH_3={intermediate_output}',
273-
f'MAIN_KEYMAP_PATH_4={intermediate_output}',
274-
f'MAIN_KEYMAP_PATH_5={intermediate_output}',
270+
f'MAIN_KEYMAP_PATH_1={unix_style_path(intermediate_output)}',
271+
f'MAIN_KEYMAP_PATH_2={unix_style_path(intermediate_output)}',
272+
f'MAIN_KEYMAP_PATH_3={unix_style_path(intermediate_output)}',
273+
f'MAIN_KEYMAP_PATH_4={unix_style_path(intermediate_output)}',
274+
f'MAIN_KEYMAP_PATH_5={unix_style_path(intermediate_output)}',
275275
f'KEYMAP_JSON={keymap_json}',
276276
f'KEYMAP_PATH={generated_files_path}',
277277
])

lib/python/qmk/cli/generate/make_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from qmk.commands import dump_lines
99
from qmk.keyboard import keyboard_completer, keyboard_folder
1010
from qmk.keymap import keymap_completer, locate_keymap
11-
from qmk.path import normpath, FileType
11+
from qmk.path import normpath, FileType, unix_style_path
1212

1313

1414
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON.')
@@ -53,4 +53,4 @@ def generate_make_dependencies(cli):
5353
for file in interesting_files:
5454
check_files.append(Path('users') / cli.args.keymap / file)
5555

56-
dump_lines(cli.args.output, [f'generated-files: $(wildcard {found})\n' for found in check_files])
56+
dump_lines(cli.args.output, [f'generated-files: $(wildcard {unix_style_path(found)})\n' for found in check_files])

lib/python/qmk/commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from qmk.json_schema import json_load, validate
1313
from qmk.keyboard import keyboard_alias_definitions
1414
from qmk.util import maybe_exit
15+
from qmk.path import unix_style_path
1516

1617

1718
def find_make():
@@ -85,7 +86,7 @@ def build_environment(args):
8586
envs = parse_env_vars(args)
8687

8788
if HAS_QMK_USERSPACE:
88-
envs['QMK_USERSPACE'] = Path(QMK_USERSPACE).resolve()
89+
envs['QMK_USERSPACE'] = unix_style_path(Path(QMK_USERSPACE).resolve())
8990

9091
return envs
9192

0 commit comments

Comments
 (0)