Skip to content

Commit aebf092

Browse files
vmorozaduh95
authored andcommitted
build: keep PGO settings out of addon builds
Gate PGO generation and use flags on configuring_node so native addons do not inherit Node.js-specific profiling settings from process.config. The inherited Windows profile-use option is unquoted and breaks addon builds when their paths contain spaces. Preserve Node.js PGO flags and the Windows host-toolset exclusion. Expand configuring_node early for the Windows target condition. Refs: nodejs/node-addon-api#1763 Signed-off-by: Vladimir Morozov <vmorozov@microsoft.com> Assisted-by: AI coding assistant PR-URL: #67638 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
1 parent 05f33bf commit aebf092

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎common.gypi‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@
235235
# frames otherwise, even with --call-graph dwarf.
236236
'cflags': [ '-fno-omit-frame-pointer' ],
237237
}],
238-
['OS=="linux" or OS=="openharmony"', {
238+
# PGO settings are specific to Node, not addons built with node-gyp.
239+
['(OS=="linux" or OS=="openharmony") and configuring_node', {
239240
'conditions': [
240241
['enable_pgo_generate=="true"', {
241242
'cflags': ['<(pgo_generate)'],
@@ -247,7 +248,7 @@
247248
},],
248249
],
249250
},],
250-
['OS=="mac"', {
251+
['OS=="mac" and configuring_node', {
251252
'conditions': [
252253
['enable_pgo_generate=="true"', {
253254
'xcode_settings': {
@@ -312,7 +313,7 @@
312313
},],
313314
],
314315
'target_conditions': [
315-
['_toolset=="target"', {
316+
['_toolset=="target" and <(configuring_node)', {
316317
'conditions': [
317318
['enable_pgo_generate=="true"', {
318319
'msvs_settings': {

0 commit comments

Comments
 (0)