Skip to content

Commit e3ae1bf

Browse files
committed
build: enable cctest to use generated objects
This commit tries to make it simpler to add unit tests (cctest) for code that needs to test node core funtionality but that might not be appropriate as an addon or a JavaScript test. An example of this could be adding functionality targeted for situations when Node itself is embedded. Currently it was not as easy, or efficient, as one would have hoped to add such tests. The object output directories vary for different operating systems which we need to link to so that we don't have an additional compilation step. PR-URL: #11956 Ref: #9163 Reviewed-By: James M Snell <[email protected]>
1 parent b09f738 commit e3ae1bf

File tree

7 files changed

+507
-352
lines changed

7 files changed

+507
-352
lines changed

common.gypi

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,25 @@
3535
['OS == "win"', {
3636
'os_posix': 0,
3737
'v8_postmortem_support%': 'false',
38+
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
39+
'V8_BASE': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
3840
}, {
3941
'os_posix': 1,
4042
'v8_postmortem_support%': 'true',
4143
}],
42-
['GENERATOR == "ninja" or OS== "mac"', {
43-
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
44+
['OS== "mac"', {
45+
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
4446
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
4547
}, {
46-
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
47-
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
48+
'conditions': [
49+
['GENERATOR=="ninja"', {
50+
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
51+
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/tools/gyp/libv8_base.a',
52+
}, {
53+
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
54+
'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
55+
}],
56+
],
4857
}],
4958
['openssl_fips != ""', {
5059
'OPENSSL_PRODUCT': 'libcrypto.a',

0 commit comments

Comments
 (0)