Skip to content

Commit 89a7d96

Browse files
committed
Added option to enable ASAN in debug builds
1 parent 903e3c2 commit 89a7d96

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

src/Configure.rc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ BEGIN
105105
"Button",BS_AUTORADIOBUTTON,153,20,124,10
106106
CONTROL "Statically link C/C++ runtime library",IDC_LINK_RUNTIME,"Button",BS_AUTOCHECKBOX |
107107
WS_TABSTOP,15,35,133,10
108-
GROUPBOX "Build options",IDC_STATIC,5,55,304,150
108+
GROUPBOX "Build options",IDC_STATIC,5,55,304,165
109109
LTEXT "Quantum depth",IDC_STATIC,205,70,55,8
110110
COMBOBOX IDC_QUANTUM_DEPTH,260,68,45,50,CBS_DROPDOWNLIST |
111111
WS_VSCROLL | WS_TABSTOP
@@ -141,6 +141,9 @@ BEGIN
141141
CONTROL "Use registry settings or hard-coded paths to locate installed components",
142142
IDC_INSTALLED_SUPPORT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
143143
15,190,240,10
144+
CONTROL "Enable ASAN in debug builds",
145+
IDC_ENABLE_ASAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
146+
15,205,240,10
144147
END
145148

146149
IDD_FINISHED_PAGE DIALOG 0, 0, 318, 233

src/Options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Options
2727

2828
Architecture architecture;
2929
BOOL enableDpc;
30+
BOOL enableAsan;
3031
BOOL excludeDeprecated;
3132
BOOL includeIncompatibleLicense;
3233
BOOL includeNonWindows;

src/Pages/TargetPage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ void TargetPage::DoDataExchange(CDataExchange* pDX)
4949
DDX_Check(pDX,IDC_EXCLUDE_DEPRECATED,_options->excludeDeprecated);
5050
DDX_Check(pDX,IDC_INSTALLED_SUPPORT,_options->installedSupport);
5151
DDX_Check(pDX,IDC_ZERO_CONFIGURATION_SUPPORT,_options->zeroConfigurationSupport);
52+
DDX_Check(pDX,IDC_ENABLE_ASAN,_options->enableAsan);
5253
}
5354

5455
BOOL TargetPage::OnInitDialog()

src/Project.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,8 @@ void Project::writeProperties(wofstream &file) const
668668
file << " <ProjectName>" << fullName() << "</ProjectName>" << endl;
669669
file << " <ProjectGuid>{" << guid() << "}</ProjectGuid>" << endl;
670670
file << " <Keyword>" << _options.platform() << "Proj</Keyword>" << endl;
671+
if (_options.enableAsan)
672+
file << " <EnableASAN Condition=\"'$(Configuration)'=='Debug'\">true</EnableASAN>" << endl;
671673
file << " </PropertyGroup>" << endl;
672674
file << " <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />" << endl;
673675
file << " <PropertyGroup Label=\"Configuration\">" << endl;

src/resource.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929
#define IDC_EXCLUDE_DEPRECATED 1014
3030
#define IDC_INSTALLED_SUPPORT 1015
3131
#define IDC_ZERO_CONFIGURATION_SUPPORT 1016
32-
#define IDC_FINISHED_TEXT 1017
33-
#define IDD_WAITDIALOG 1018
34-
#define IDC_MSGCTRL 1019
35-
#define IDC_PROGRESSCTRL 1020
32+
#define IDC_ENABLE_ASAN 1017
33+
#define IDC_FINISHED_TEXT 1018
34+
#define IDD_WAITDIALOG 1019
35+
#define IDC_MSGCTRL 1020
36+
#define IDC_PROGRESSCTRL 1021
3637

3738
// Next default values for new objects
3839
//

0 commit comments

Comments
 (0)