From b41f88f47a146fd19a05c4087f6903e66461425e Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 12 Feb 2020 20:45:18 +0100 Subject: [PATCH] Simplify the code around the call to gen_main_file There's no need to keep the directory lists separated until the last minute. No semantic change. The generated files change slightly because there was one directory list where slashes were not changed to backslashes like in the other five. This does not affect their semantics. --- scripts/generate_visualc_files.pl | 54 +++++++++++++++---------------- visualc/VS2010/mbedTLS.vcxproj | 14 ++++---- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index adef3bda6..5565729f9 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -31,9 +31,12 @@ my @thirdparty_source_dirs = qw( 3rdparty/everest/library/kremlib 3rdparty/everest/library/legacy ); -my @thirdparty_excluded = qw( + +my @excluded_files = qw( 3rdparty/everest/library/Hacl_Curve25519.c ); +my %excluded_files = (); +foreach (@excluded_files) { $excluded_files{$_} = 1 } # Need windows line endings! my $vsx_hdr_tpl = <; - my @psa_headers = <$psa_header_dir/*.h>; - my @source_headers = <$source_dir/*.h>; - my @sources = <$source_dir/*.c>; - map { s!/!\\!g } @mbedtls_headers; - map { s!/!\\!g } @psa_headers; - map { s!/!\\!g } @sources; + my @header_dirs = ( + $mbedtls_header_dir, + $psa_header_dir, + $source_dir, + @thirdparty_header_dirs, + ); + my @headers = (map { <$_/*.h> } @header_dirs); + my @source_dirs = ( + $source_dir, + @thirdparty_source_dirs, + ); + my @sources = (map { <$_/*.c> } @source_dirs); - my @thirdparty_headers = map { <$_/*.h> } @thirdparty_header_dirs; - my @thirdparty_sources = map { <$_/*.c> } @thirdparty_source_dirs; - @thirdparty_sources = grep { ! is_thirdparty_excluded($_) } @thirdparty_sources; - map { s!/!\\!g } @thirdparty_headers; - map { s!/!\\!g } @thirdparty_sources; + @headers = grep { ! $excluded_files{$_} } @headers; + @sources = grep { ! $excluded_files{$_} } @sources; + map { s!/!\\!g } @headers; + map { s!/!\\!g } @sources; gen_app_files( @app_list ); - gen_main_file( \@mbedtls_headers, \@psa_headers, \@source_headers, - \@thirdparty_headers, \@sources, \@thirdparty_sources, $vsx_hdr_tpl, - $vsx_src_tpl, $vsx_main_tpl_file, $vsx_main_file ); + gen_main_file( \@headers, \@sources, + $vsx_hdr_tpl, $vsx_src_tpl, + $vsx_main_tpl_file, $vsx_main_file ); gen_vsx_solution( @app_list ); diff --git a/visualc/VS2010/mbedTLS.vcxproj b/visualc/VS2010/mbedTLS.vcxproj index 0e40e3577..eb5f275a8 100644 --- a/visualc/VS2010/mbedTLS.vcxproj +++ b/visualc/VS2010/mbedTLS.vcxproj @@ -222,13 +222,13 @@ - - - - - - - + + + + + + +