win,build: add option to enable Control Flow Guard · nodejs/node@17d4074 · GitHub
Skip to content

Commit 17d4074

Browse files
huseyinacacak-janeaaduh95
authored andcommitted
win,build: add option to enable Control Flow Guard
PR-URL: #56605 Fixes: #42100 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 4af2f7f commit 17d4074

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

common.gypi

Lines changed: 11 additions & 0 deletions

configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,12 @@
819819
default=None,
820820
help='do not install the bundled Corepack')
821821

822+
parser.add_argument('--control-flow-guard',
823+
action='store_true',
824+
dest='enable_cfg',
825+
default=None,
826+
help='enable Control Flow Guard (CFG)')
827+
822828
# Dummy option for backwards compatibility
823829
parser.add_argument('--without-report',
824830
action='store_true',
@@ -1443,6 +1449,7 @@ def configure_node(o):
14431449
o['variables']['node_prefix'] = options.prefix
14441450
o['variables']['node_install_npm'] = b(not options.without_npm)
14451451
o['variables']['node_install_corepack'] = b(not options.without_corepack)
1452+
o['variables']['control_flow_guard'] = b(options.enable_cfg)
14461453
o['variables']['node_use_amaro'] = b(not options.without_amaro)
14471454
o['variables']['debug_node'] = b(options.debug_node)
14481455
o['default_configuration'] = 'Debug' if options.debug else 'Release'

vcbuild.bat

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)