Skip to content

Commit

Permalink
feat: enable whole-program optimization native modules by default (#3…
Browse files Browse the repository at this point in the history
…7048)

* feat: enable whole-program optimization

Enable whole-program optimization in electron native modules by default.

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

* pass --with-ltcg to configure.py instead of setting variable

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

* enable ltcg only on windows

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
  • Loading branch information
3 people committed Feb 1, 2023
1 parent 751fc04 commit cb5d93e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script/generate-config-gypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def run_node_configure(target_cpu):
# Work around "No acceptable ASM compiler found" error on some System,
# it breaks nothing since Electron does not use OpenSSL.
args += ['--openssl-no-asm']

# Enable whole-program optimization for electron native modules.
if sys.platform == "win32":
args += ['--with-ltcg']
subprocess.check_call([sys.executable, configure] + args)

def read_node_config_gypi():
Expand Down

0 comments on commit cb5d93e

Please sign in to comment.