MCPcopy Index your code
hub / github.com/nodejs/node / configure_node

Function configure_node

configure.py:1819–2103  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

1817 SearchFiles('test/cctest', 'h')
1818
1819def configure_node(o):
1820 if options.dest_os == 'android':
1821 o['variables']['OS'] = 'android'
1822 o['variables']['node_enable_experimentals'] = b(options.enable_all_experimentals)
1823 o['variables']['node_prefix'] = options.prefix
1824 o['variables']['node_install_npm'] = b(not options.without_npm)
1825 o['variables']['node_install_corepack'] = b(options.with_corepack)
1826 o['variables']['control_flow_guard'] = b(options.enable_cfg)
1827 o['variables']['node_use_amaro'] = b(not options.without_amaro)
1828 o['variables']['debug_node'] = b(options.debug_node)
1829 o['variables']['debug_symbols'] = b(options.debug_symbols)
1830 if options.debug_symbols:
1831 o['cflags'] += ['-g']
1832 o['variables']['build_type%'] = 'Debug' if options.debug else 'Release'
1833 o['default_configuration'] = 'Debug' if options.debug else 'Release'
1834 if options.error_on_warn and options.suppress_all_error_on_warn:
1835 raise Exception('--error_on_warn is incompatible with --suppress_all_error_on_warn.')
1836 o['variables']['error_on_warn'] = b(options.error_on_warn)
1837 o['variables']['suppress_all_error_on_warn'] = b(options.suppress_all_error_on_warn)
1838 o['variables']['use_prefix_to_find_headers'] = b(options.use_prefix_to_find_headers)
1839
1840 host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc()
1841 target_arch = options.dest_cpu or host_arch
1842 # ia32 is preferred by the build tools (GYP) over x86 even if we prefer the latter
1843 # the Makefile resets this to x86 afterward
1844 if target_arch == 'x86':
1845 target_arch = 'ia32'
1846 # x86_64 is common across linuxes, allow it as an alias for x64
1847 if target_arch == 'x86_64':
1848 target_arch = 'x64'
1849 o['variables']['host_arch'] = host_arch
1850 o['variables']['target_arch'] = target_arch
1851 o['variables']['node_byteorder'] = sys.byteorder
1852
1853 # On Windows, cargo may default to the GNU target (e.g. x86_64-pc-windows-gnu)
1854 # but Node.js requires MSVC-compatible libraries. Set explicit Rust target
1855 # triple for the target architecture.
1856 o['variables']['cargo_rust_target'] = ''
1857 if flavor == 'win':
1858 o['variables']['cargo_rust_target'] = \
1859 'aarch64-pc-windows-msvc' if target_arch == 'arm64' else 'x86_64-pc-windows-msvc'
1860 # Always set the Rust target for x64 macOS in case we will be building
1861 # under Rosetta 2.
1862 if flavor == 'mac' and target_arch == 'x64':
1863 o['variables']['cargo_rust_target'] = 'x86_64-apple-darwin'
1864
1865 # Allow overriding the compiler - needed by embedders.
1866 if options.use_clang:
1867 o['variables']['clang'] = 1
1868
1869 cross_compiling = (options.cross_compiling
1870 if options.cross_compiling is not None
1871 else target_arch != host_arch)
1872 if cross_compiling:
1873 os.environ['GYP_CROSSCOMPILE'] = "1"
1874 if options.unused_without_snapshot:
1875 warn('building --without-snapshot is no longer possible')
1876

Callers 1

configure.pyFile · 0.85

Calls 15

host_arch_winFunction · 0.85
host_arch_ccFunction · 0.85
intFunction · 0.85
configure_armFunction · 0.85
configure_mipsFunction · 0.85
configure_zosFunction · 0.85
gcc_version_geFunction · 0.85
clang_version_geFunction · 0.85
bFunction · 0.70
warnFunction · 0.70
errorFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…