|
730 | 730 | 'Ws2_32.lib', |
731 | 731 | ], |
732 | 732 | }], |
733 | | - # Whole-program optimization: either LTCG or PGO |
734 | | - ['node_with_ltcg=="true" or enable_pgo_generate=="true" or enable_pgo_use=="true"', { |
| 733 | + # Thin LTO for node_main.cc and linker (scoped to node_exe) |
| 734 | + ['node_with_ltcg=="true"', { |
735 | 735 | 'msvs_settings': { |
736 | 736 | 'VCCLCompilerTool': { |
737 | | - 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for both LTCG and PGO |
| 737 | + 'AdditionalOptions': ['-flto=thin'], |
| 738 | + }, |
| 739 | + 'VCLinkerTool': { |
| 740 | + 'AdditionalOptions': ['-flto=thin'], |
738 | 741 | }, |
| 742 | + }, |
| 743 | + }], |
| 744 | + # Whole-program optimization: either Thin LTO or PGO |
| 745 | + ['node_with_ltcg=="true" or enable_pgo_generate=="true" or enable_pgo_use=="true"', { |
| 746 | + 'msvs_settings': { |
739 | 747 | 'VCLinkerTool': { |
740 | 748 | 'OptimizeReferences': 2, # /OPT:REF |
741 | 749 | 'EnableCOMDATFolding': 2, # /OPT:ICF |
742 | 750 | 'LinkIncremental': 1, # disable incremental linking |
743 | | - } |
| 751 | + }, |
744 | 752 | }, |
745 | | - 'conditions': [ |
746 | | - # LTCG-specific settings (only when PGO not active) |
747 | | - ['node_with_ltcg=="true" and enable_pgo_generate!="true" and enable_pgo_use!="true"', { |
748 | | - 'msvs_settings': { |
749 | | - 'VCLibrarianTool': { |
750 | | - 'AdditionalOptions': [ |
751 | | - '/LTCG:INCREMENTAL', # link time code generation |
752 | | - ], |
753 | | - }, |
754 | | - 'VCLinkerTool': { |
755 | | - 'AdditionalOptions': [ |
756 | | - '/LTCG:INCREMENTAL', # incremental link-time code generation |
757 | | - ], |
758 | | - }, |
759 | | - }, |
760 | | - }], |
761 | | - ] |
762 | 753 | }, { |
| 754 | + # No whole-program optimization |
763 | 755 | 'msvs_settings': { |
764 | | - 'VCCLCompilerTool': { |
765 | | - 'WholeProgramOptimization': 'false' |
766 | | - }, |
767 | 756 | 'VCLinkerTool': { |
768 | | - 'LinkIncremental': 2 # enable incremental linking |
| 757 | + 'LinkIncremental': 2, # enable incremental linking |
769 | 758 | }, |
770 | 759 | }, |
771 | | - }], |
| 760 | + }], |
772 | 761 | ['node_use_node_snapshot=="true"', { |
773 | 762 | 'dependencies': [ |
774 | 763 | 'node_mksnapshot', |
|
1171 | 1160 | [ 'debug_nghttp2==1', { |
1172 | 1161 | 'defines': [ 'NODE_DEBUG_NGHTTP2=1' ] |
1173 | 1162 | }], |
| 1163 | + # Thin LTO for node sources (scoped to libnode, not global) |
| 1164 | + ['node_with_ltcg=="true"', { |
| 1165 | + 'msvs_settings': { |
| 1166 | + 'VCCLCompilerTool': { |
| 1167 | + 'AdditionalOptions': ['-flto=thin'], |
| 1168 | + }, |
| 1169 | + 'VCLibrarianTool': { |
| 1170 | + 'AdditionalOptions': ['-flto=thin'], |
| 1171 | + }, |
| 1172 | + }, |
| 1173 | + }], |
1174 | 1174 | ], |
1175 | 1175 | 'actions': [ |
1176 | 1176 | { |
|
0 commit comments