diff --git a/scripts/data_files/vs2010-app-template.vcxproj b/scripts/data_files/vs2010-app-template.vcxproj
index 5480a445c..e7bb122d8 100644
--- a/scripts/data_files/vs2010-app-template.vcxproj
+++ b/scripts/data_files/vs2010-app-template.vcxproj
@@ -93,7 +93,9 @@
Level3
Disabled
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Console
@@ -113,7 +115,9 @@
Level3
Disabled
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Console
@@ -135,7 +139,9 @@
true
true
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Console
@@ -155,7 +161,9 @@
true
true
WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Console
diff --git a/scripts/data_files/vs2010-main-template.vcxproj b/scripts/data_files/vs2010-main-template.vcxproj
index 7071cd28a..81bbbe669 100644
--- a/scripts/data_files/vs2010-main-template.vcxproj
+++ b/scripts/data_files/vs2010-main-template.vcxproj
@@ -86,7 +86,9 @@
Level3
Disabled
WIN32;_DEBUG;_WINDOWS;_USRDLL;MBEDTLS_EXPORTS;KRML_VERIFIED_UINT128;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
CompileAsC
@@ -101,7 +103,9 @@
Level3
Disabled
WIN32;_DEBUG;_WINDOWS;_USRDLL;MBEDTLS_EXPORTS;KRML_VERIFIED_UINT128;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
CompileAsC
@@ -118,7 +122,9 @@
true
true
WIN32;NDEBUG;_WINDOWS;_USRDLL;MBEDTLS_EXPORTS;KRML_VERIFIED_UINT128;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Windows
@@ -136,7 +142,9 @@
true
true
WIN64;NDEBUG;_WINDOWS;_USRDLL;MBEDTLS_EXPORTS;KRML_VERIFIED_UINT128;%(PreprocessorDefinitions)
- ../../include;../../3rdparty/everest/include/;../../3rdparty/everest/include/everest;../../3rdparty/everest/include/everest/vs2010;../../3rdparty/everest/include/everest/kremlib
+
+INCLUDE_DIRECTORIES
+
Windows
diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl
index 5565729f9..5b3bfcc47 100755
--- a/scripts/generate_visualc_files.pl
+++ b/scripts/generate_visualc_files.pl
@@ -32,6 +32,18 @@ my @thirdparty_source_dirs = qw(
3rdparty/everest/library/legacy
);
+# Directories to add to the include path.
+# Order matters in case there are files with the same name in more than
+# one directory: the compiler will use the first match.
+my @include_directories = qw(
+ include
+ 3rdparty/everest/include/
+ 3rdparty/everest/include/everest
+ 3rdparty/everest/include/everest/vs2010
+ 3rdparty/everest/include/everest/kremlib
+);
+my $include_directories = join(';', map {"../../$_"} @include_directories);
+
my @excluded_files = qw(
3rdparty/everest/library/Hacl_Curve25519.c
);
@@ -123,6 +135,7 @@ sub gen_app {
$content =~ s//$srcs/g;
$content =~ s//$appname/g;
$content =~ s//$guid/g;
+ $content =~ s/\r\nINCLUDE_DIRECTORIES\r\n +/$include_directories/g;
content_to_file( $content, "$dir/$appname.$ext" );
}
@@ -167,6 +180,7 @@ sub gen_main_file {
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/\r\nINCLUDE_DIRECTORIES\r\n +/$include_directories/g;
content_to_file( $out, $main_out );
}