Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit d3f3d40

Browse files
committed
Add Release configurations and optimizations
1 parent a8296f1 commit d3f3d40

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

binding.gyp

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,40 @@
130130
"NOMINMAX"
131131
],
132132
}]
133-
]
134-
}
133+
],
134+
'default_configuration': 'Release',
135+
'configurations': {
136+
# Release Settings
137+
'Release': {
138+
'defines': [ 'NDEBUG' ],
139+
"cflags": [ "-fno-exceptions", "-Ofast" ],
140+
"cflags_cc": [ "-fno-exceptions", "-Ofast", "-std=c++<(STANDARD)" ],
141+
"xcode_settings": {
142+
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
143+
"CLANG_CXX_LIBRARY": "libc++",
144+
"CLANG_CXX_LANGUAGE_STANDARD": "c++<(STANDARD)",
145+
'MACOSX_DEPLOYMENT_TARGET': "<(MACOSX_DEPLOYMENT_TARGET)"
146+
}, # XCODE
147+
"msvs_settings": {
148+
"VCCLCompilerTool": {
149+
'ExceptionHandling': 0, # /EHsc
150+
'MultiProcessorCompilation': 'true',
151+
'RuntimeTypeInfo': 'false',
152+
'Optimization': 3, # full optimizations /O2 == /Og /Oi /Ot /Oy /Ob2 /GF /Gy
153+
'StringPooling': 'true', # pool string literals
154+
"AdditionalOptions": [
155+
# C++ standard
156+
"/std:c++<(STANDARD)",
157+
158+
# Optimizations
159+
"/O2",
160+
# "/Ob3", # aggressive inline
161+
"/GL", # whole Program Optimization # /LTCG is implied with /GL.
162+
"/DNDEBUG" # turn off asserts
163+
],
164+
}
165+
} # MSVC
166+
}, # Release
167+
}, # configurations
168+
} # target-defaults
135169
}

0 commit comments

Comments
 (0)