Skip to content

Commit 47afd83

Browse files
author
Anton Kruglyakov
committed
Fix build scripts, update GC and enable allocations tracking
1 parent 9d89cfb commit 47afd83

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

external/buildscripts/build_runtime_vs.pl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
my $targetArch = "";
2121
my $debug = 0;
2222
my $gc = "bdwgc";
23+
my @vsVersions = (2019, 2022, 2017);
24+
my @vsEditions = ("Professional", "Enterprise", "Community");
25+
my @vsBaseFolder = ("ProgramFiles(x86)", "ProgramFiles");
2326

2427
GetOptions(
2528
'build=i'=>\$build,
@@ -38,17 +41,26 @@ sub CompileVCProj
3841
{
3942
my $sln = shift;
4043
my $config;
41-
my $vsInstallRoot = $ENV{"ProgramFiles(x86)"} . "/Microsoft Visual Studio";
4244

43-
my $msbuild = "$vsInstallRoot/2019/Professional/MSBuild/Current/Bin/MSBuild.exe";
45+
my $msbuild = "";
46+
MSBUILDLOOP: foreach my $vsFolder (@vsBaseFolder)
47+
{
48+
foreach my $vsEdition (@vsEditions)
49+
{
50+
foreach my $vsVersion (@vsVersions)
51+
{
52+
$msbuild = "$ENV{$vsFolder}/Microsoft Visual Studio/$vsVersion/$vsEdition/MSBuild/Current/Bin/MSBuild.exe";
53+
last MSBUILDLOOP if (-e -x $msbuild)
54+
}
55+
}
56+
}
4457

4558
if (!(-e -x $msbuild))
4659
{
47-
print (">>> Unable to find executable MSBuild for vs19 at: $msbuild\nFalling back to vs17\n");
48-
$msbuild = "$vsInstallRoot/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe";
60+
print (">>> Unable to find executable MSBuild\n");
4961
}
5062

51-
$config = $debug ? "Debug" : "Release";
63+
$config = $debug ? "Debug" : "Release";
5264
my $arch = $targetArch;
5365

5466
my $target = $clean ? "/t:Clean,Build" :"/t:Build";

winconfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
/* Windows MSVC builds defaults to preemptive suspend. Disable ENABLE_HYBRID_SUSPEND defines. */
2424
#undef ENABLE_HYBRID_SUSPEND
2525

26+
/* Override allocators for Memory Profiler memory tracking */
27+
#define ENABLE_OVERRIDABLE_ALLOCATORS 1
28+
2629
/* No ENABLE_DEFINES below this point */
2730

2831
/* Keep in sync with netcore runtime-preset in configure.ac */

0 commit comments

Comments
 (0)