Skip to content

Commit 6c9076e

Browse files
authored
Merge pull request #237 from gilles-peskine-arm/config_checks_generator-fix-windows-path
Fix generate_config_checks.py --list on Windows
2 parents 32e01d4 + 7082fdc commit 6c9076e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/mbedtls_framework/config_checks_generator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import argparse
1111
import enum
1212
import os
13+
import posixpath
1314
import re
1415
import sys
1516
import textwrap
@@ -256,7 +257,9 @@ def generate_header_files(branch_data: BranchData,
256257
"""Generate the header files to include before and after *config.h."""
257258
for position in Position:
258259
generator = HeaderGenerator(branch_data, position)
259-
yield os.path.join(directory, generator.output_file_name())
260+
# Make sure to output a path with / even on Windows, so that
261+
# it can be consumed by tools such as CMake.
262+
yield posixpath.join(directory, generator.output_file_name())
260263
if not list_only:
261264
generator.write(directory)
262265

@@ -280,7 +283,7 @@ def main(branch_data: BranchData) -> None:
280283
parser.add_argument('--list-for-cmake', action='store_true',
281284
help='List generated files in CMake-friendly format and exit')
282285
parser.add_argument('output_directory', metavar='DIR', nargs='?',
283-
default=os.path.join(root, branch_data.header_directory),
286+
default=posixpath.join(root, branch_data.header_directory),
284287
help='output file location (default: %(default)s)')
285288
options = parser.parse_args()
286289
list_only = options.list or options.list_for_cmake

0 commit comments

Comments
 (0)