xref: /aosp_15_r20/external/cronet/build/config/win/control_flow_guard.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2020 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/sanitizers/sanitizers.gni")
6
7declare_args() {
8  # Set this to true to enable generation of CFG indirect call dispatch
9  # guards.
10  win_enable_cfg_guards = !is_debug && !is_asan
11}
12
13if (win_enable_cfg_guards) {
14  # Control Flow Guard (CFG)
15  # https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx
16  # /DYNAMICBASE (ASLR) is turned off in debug builds, therefore CFG can't be
17  # turned on either.
18  # ASan and CFG leads to slow process startup. Chromium's test runner uses
19  # lots of child processes, so this means things are really slow. Disable CFG
20  # for now. https://crbug.com/846966
21  assert(!is_debug && !is_asan,
22         "CFG does not work well in debug builds or with ASAN")
23}
24