Skip to content

Commit 9cf88c1

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= [email protected], [email protected] Review-Url: https://codereview.chromium.org/2149963002 Cr-Commit-Position: refs/heads/master@{#37814}
1 parent 7e4e6c5 commit 9cf88c1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gypfiles/standalone.gypi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'includes': ['toolchain.gypi'],
3434
'variables': {
3535
'component%': 'static_library',
36+
'force_dynamic_crt%': 0,
3637
'clang_xcode%': 0,
3738
# Track where uninitialized memory originates from. From fastest to
3839
# slowest: 0 - no tracking, 1 - track only the initial allocation site, 2

gypfiles/toolchain.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@
11101110
'VCCLCompilerTool': {
11111111
'Optimization': '0',
11121112
'conditions': [
1113-
['component=="shared_library"', {
1113+
['component=="shared_library" or force_dynamic_crt==1', {
11141114
'RuntimeLibrary': '3', # /MDd
11151115
}, {
11161116
'RuntimeLibrary': '1', # /MTd
@@ -1162,7 +1162,7 @@
11621162
'StringPooling': 'true',
11631163
'BasicRuntimeChecks': '0',
11641164
'conditions': [
1165-
['component=="shared_library"', {
1165+
['component=="shared_library" or force_dynamic_crt==1', {
11661166
'RuntimeLibrary': '3', #/MDd
11671167
}, {
11681168
'RuntimeLibrary': '1', #/MTd
@@ -1353,7 +1353,7 @@
13531353
'FavorSizeOrSpeed': '0',
13541354
'StringPooling': 'true',
13551355
'conditions': [
1356-
['component=="shared_library"', {
1356+
['component=="shared_library" or force_dynamic_crt==1', {
13571357
'RuntimeLibrary': '2', #/MD
13581358
}, {
13591359
'RuntimeLibrary': '0', #/MT

0 commit comments

Comments
 (0)