From cabae3d29ee81536388fb411016997354359c509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Thu, 6 May 2021 15:14:16 +0200 Subject: [PATCH] Specify output name for MSVC as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output file was being created in the working directory, instead of the temp directory. Signed-off-by: Bence Szépkúti --- scripts/mbedtls_dev/c_build_helper.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/mbedtls_dev/c_build_helper.py b/scripts/mbedtls_dev/c_build_helper.py index 9215d648c..ddef10fbe 100644 --- a/scripts/mbedtls_dev/c_build_helper.py +++ b/scripts/mbedtls_dev/c_build_helper.py @@ -95,7 +95,7 @@ def get_c_expression_values( caller=__name__, file_label='', header='', include_path=None, keep_c=False, -): # pylint: disable=too-many-arguments +): # pylint: disable=too-many-arguments, too-many-locals """Generate and run a program to print out numerical values for expressions. * ``cast_to``: a C type. @@ -131,10 +131,9 @@ def get_c_expression_values( cc_is_msvc = ('\\' + cc).lower().endswith('\\cl.exe') cmd = [cc] cmd += ['-I' + dir for dir in include_path] - # MSVC doesn't support -o to specify the output file, but we use its - # default output file name. - if not cc_is_msvc: - cmd += ['-o', exe_name] + # MSVC has deprecated using -o to specify the output file. + output_opt = '-Fe' if cc_is_msvc else '-o' + cmd += [output_opt + exe_name] subprocess.check_call(cmd + [c_name]) if keep_c: sys.stderr.write('List of {} tests kept at {}\n'