Skip to content

Commit

Permalink
tools: refactor v8_pch config
Browse files Browse the repository at this point in the history
Avoid repetition by defining a new GYP target.
  • Loading branch information
targos committed Apr 5, 2023
1 parent 25858e3 commit 05e5f0d
Showing 1 changed file with 23 additions and 48 deletions.
71 changes: 23 additions & 48 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
},
},
'targets': [
{
'target_name': 'v8_pch',
'type': 'none',
'toolsets': ['host', 'target'],
'conditions': [
['OS=="win"', {
'direct_dependent_settings': {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
},
}],
],
}, # v8_pch
{
'target_name': 'run_torque',
'type': 'none',
Expand Down Expand Up @@ -244,6 +261,7 @@
'torque_generated_initializers',
'v8_base_without_compiler',
'v8_shared_internal_headers',
'v8_pch',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
Expand Down Expand Up @@ -318,14 +336,6 @@
'<(V8_ROOT)/src/builtins/builtins-intl-gen.cc',
],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
],
}, # v8_initializers
{
Expand Down Expand Up @@ -745,16 +755,9 @@
'v8_internal_headers',
'v8_libbase',
'v8_shared_internal_headers',
'v8_pch',
],
'conditions': [
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
['v8_enable_turbofan==1', {
'dependencies': ['v8_compiler_sources'],
}, {
Expand All @@ -775,21 +778,14 @@
'v8_libbase',
'v8_shared_internal_headers',
'v8_turboshaft',
'v8_pch',
],
'conditions': [
['v8_enable_turbofan==1', {
'dependencies': ['v8_compiler_sources'],
}, {
'sources': ['<(V8_ROOT)/src/compiler/turbofan-disabled.cc'],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
],
}, # v8_compiler
{
Expand All @@ -804,20 +800,11 @@
'v8_base_without_compiler',
'v8_libbase',
'v8_shared_internal_headers',
'v8_pch',
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_turboshaft.*?sources = ")',
],
'conditions': [
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
],
}, # v8_turboshaft
{
'target_name': 'v8_compiler_for_mksnapshot',
Expand Down Expand Up @@ -865,6 +852,7 @@
'v8_internal_headers',
'v8_maybe_icu',
'v8_zlib',
'v8_pch',
],
'includes': ['inspector.gypi'],
'direct_dependent_settings': {
Expand Down Expand Up @@ -1022,12 +1010,6 @@
],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
# This will prevent V8's .cc files conflicting with the inspector's
# .cpp files in the same shard.
'msvs_settings': {
Expand Down Expand Up @@ -1539,6 +1521,7 @@
'v8_libplatform',
'v8_maybe_icu',
'v8_turboshaft',
'v8_pch',
# "build/win:default_exe_manifest",
],
'sources': [
Expand All @@ -1548,14 +1531,6 @@
['want_separate_host_toolset', {
'toolsets': ['host'],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
],
}, # mksnapshot
{
Expand Down

0 comments on commit 05e5f0d

Please sign in to comment.