build: [gn] use clang and custom stdlib when building node on linux
This commit is contained in:
parent
d4cf3cee22
commit
1e1adef9b6
2 changed files with 31 additions and 0 deletions
|
@ -72,6 +72,9 @@ action("gyp_node") {
|
|||
# This has _gn suffixed otherwise it gets overridden by a shlib_suffix
|
||||
# that's set in node's gyp files. Don't ask me 🤷
|
||||
"-D", "shlib_suffix_gn=" + shlib_suffix,
|
||||
"-D", "llvm_dir=" + rebase_path("//third_party/llvm-build/Release+Asserts"),
|
||||
"-D", "libcxx_dir=" + rebase_path("//buildtools/third_party/libc++"),
|
||||
"-D", "libcxxabi_dir=" + rebase_path("//buildtools/third_party/libc++abi"),
|
||||
"-Goutput_dir=./$target_out_dir", # bizarrely, gyp generates from the build root instead of from cwd
|
||||
"-fninja",
|
||||
rebase_path("//third_party/electron_node/node.gyp", root_build_dir),
|
||||
|
|
|
@ -6,6 +6,34 @@
|
|||
|
||||
'shlib_suffix': '<(shlib_suffix_gn)',
|
||||
},
|
||||
'conditions': [
|
||||
['OS=="linux"', {
|
||||
'make_global_settings': [
|
||||
['CC', '<(llvm_dir)/bin/clang'],
|
||||
['CXX', '<(llvm_dir)/bin/clang++'],
|
||||
['CC.host', '$(CC)'],
|
||||
['CXX.host', '$(CXX)'],
|
||||
],
|
||||
'target_defaults': {
|
||||
'target_conditions': [
|
||||
['_toolset=="target"', {
|
||||
'cflags_cc': [
|
||||
'-std=gnu++14',
|
||||
'-nostdinc++',
|
||||
'-isystem<(libcxx_dir)/trunk/include',
|
||||
'-isystem<(libcxxabi_dir)/trunk/include',
|
||||
],
|
||||
'ldflags': [
|
||||
'-nostdlib++',
|
||||
],
|
||||
'libraries': [
|
||||
'../../../../../../libc++.so',
|
||||
],
|
||||
}]
|
||||
]
|
||||
}
|
||||
}]
|
||||
],
|
||||
'target_defaults': {
|
||||
'target_conditions': [
|
||||
['_target_name=="node_lib"', {
|
||||
|
|
Loading…
Reference in a new issue