Skip to content

Commit 6f68f30

Browse files
sxaCommit bot
authored andcommitted
[build] Add force_dynamic_crt option to build a static library with /MD on windows
Adds option to build a V8 library statically, but with the options on windows that allows it to be subsequently included in another DLL. On Windows this is required for it to correclty link against the correct C++ runtime. Require for our Node.js shared library build. Reference: nodejs/node#7487 BUG= R=machenbach@chromium.org, michael_dawson@ca.ibm.com Committed: https://crrev.com/9cf88c1c364cf76c1e745aa63196768435e8ef5d Review-Url: https://codereview.chromium.org/2149963002 Cr-Original-Commit-Position: refs/heads/master@{#37814} Cr-Commit-Position: refs/heads/master@{#37856}
1 parent ceb0afb commit 6f68f30

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

gypfiles/toolchain.gypi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'coverage%': 0,
4242
'v8_target_arch%': '<(target_arch)',
4343
'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',
44+
'force_dynamic_crt%': 0,
4445
# Native Client builds currently use the V8 ARM JIT and
4546
# arm/simulator-arm.cc to defer the significant effort required
4647
# for NaCl JIT support. The nacl_target_arch variable provides
@@ -1110,7 +1111,7 @@
11101111
'VCCLCompilerTool': {
11111112
'Optimization': '0',
11121113
'conditions': [
1113-
['component=="shared_library"', {
1114+
['component=="shared_library" or force_dynamic_crt==1', {
11141115
'RuntimeLibrary': '3', # /MDd
11151116
}, {
11161117
'RuntimeLibrary': '1', # /MTd
@@ -1162,7 +1163,7 @@
11621163
'StringPooling': 'true',
11631164
'BasicRuntimeChecks': '0',
11641165
'conditions': [
1165-
['component=="shared_library"', {
1166+
['component=="shared_library" or force_dynamic_crt==1', {
11661167
'RuntimeLibrary': '3', #/MDd
11671168
}, {
11681169
'RuntimeLibrary': '1', #/MTd
@@ -1353,7 +1354,7 @@
13531354
'FavorSizeOrSpeed': '0',
13541355
'StringPooling': 'true',
13551356
'conditions': [
1356-
['component=="shared_library"', {
1357+
['component=="shared_library" or force_dynamic_crt==1', {
13571358
'RuntimeLibrary': '2', #/MD
13581359
}, {
13591360
'RuntimeLibrary': '0', #/MT

0 commit comments

Comments
 (0)