diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index f325e9a98..5500c6fad 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -79,31 +79,30 @@ my @excluded_files = qw( my %excluded_files = (); foreach (@excluded_files) { $excluded_files{$_} = 1 } -# Need windows line endings! my $vsx_hdr_tpl = <\r + EOT my $vsx_src_tpl = <\r + EOT my $vsx_sln_app_entry_tpl = <; close $fh; @@ -137,7 +136,7 @@ sub slurp_file { sub content_to_file { my ($content, $filename) = @_; - open my $fh, '>', $filename or die "Could not write to $filename\n"; + open my $fh, '>:crlf', $filename or die "Could not write to $filename\n"; print $fh $content; close $fh; } @@ -161,17 +160,17 @@ sub gen_app { my $srcs = ""; if( $appname eq "ssl_client2" or $appname eq "ssl_server2" or $appname eq "query_compile_time_config" ) { - $srcs .= "\r\n "; + $srcs .= "\n "; } if( $appname eq "ssl_client2" or $appname eq "ssl_server2" ) { - $srcs .= "\r\n "; + $srcs .= "\n "; } my $content = $template; $content =~ s//$srcs/g; $content =~ s//$appname/g; $content =~ s//$guid/g; - $content =~ s/INCLUDE_DIRECTORIES\r\n/$include_directories/g; + $content =~ s/INCLUDE_DIRECTORIES\n/$include_directories/g; content_to_file( $content, "$dir/$appname.$ext" ); } @@ -214,9 +213,9 @@ sub gen_main_file { my $source_entries = gen_entry_list( $src_tpl, @$sources ); my $out = slurp_file( $main_tpl ); - $out =~ s/SOURCE_ENTRIES\r\n/$source_entries/m; - $out =~ s/HEADER_ENTRIES\r\n/$header_entries/m; - $out =~ s/INCLUDE_DIRECTORIES\r\n/$library_include_directories/g; + $out =~ s/SOURCE_ENTRIES\n/$source_entries/m; + $out =~ s/HEADER_ENTRIES\n/$header_entries/m; + $out =~ s/INCLUDE_DIRECTORIES\n/$library_include_directories/g; content_to_file( $out, $main_out ); } @@ -242,8 +241,8 @@ sub gen_vsx_solution { } my $out = slurp_file( $vsx_sln_tpl_file ); - $out =~ s/APP_ENTRIES\r\n/$app_entries/m; - $out =~ s/CONF_ENTRIES\r\n/$conf_entries/m; + $out =~ s/APP_ENTRIES\n/$app_entries/m; + $out =~ s/CONF_ENTRIES\n/$conf_entries/m; content_to_file( $out, $vsx_sln_file ); }