|
43 | 43 | 'ossfuzz' : 'false', |
44 | 44 | 'linked_module_files': [ |
45 | 45 | ], |
46 | | - # We list the deps/ files out instead of globbing them in js2c.cc since we |
| 46 | + # We list the deps/ files out instead of globbing them in js2c.rs since we |
47 | 47 | # only include a subset of all the files under these directories. |
48 | 48 | # The lengths of their file names combined should not exceed the |
49 | 49 | # Windows command length limit or there would be an error. |
|
1552 | 1552 | }, # nop |
1553 | 1553 | { |
1554 | 1554 | 'target_name': 'node_js2c', |
1555 | | - 'type': 'executable', |
| 1555 | + 'type': 'none', |
1556 | 1556 | 'toolsets': ['host'], |
1557 | | - 'include_dirs': [ |
1558 | | - 'tools', |
1559 | | - 'src', |
1560 | | - ], |
1561 | | - 'sources': [ |
1562 | | - 'tools/js2c.cc', |
1563 | | - 'tools/executable_wrapper.h', |
1564 | | - 'src/embedded_data.h', |
1565 | | - 'src/embedded_data.cc', |
1566 | | - 'src/builtin_info.h', |
1567 | | - 'src/builtin_info.cc', |
| 1557 | + 'variables': { |
| 1558 | + 'node_js2c_rustc_flags': [ |
| 1559 | + '--edition=2021', |
| 1560 | + '--crate-name', |
| 1561 | + 'node_js2c', |
| 1562 | + '-C', |
| 1563 | + 'opt-level=2', |
| 1564 | + ], |
| 1565 | + }, |
| 1566 | + 'actions': [ |
| 1567 | + { |
| 1568 | + 'action_name': 'build_node_js2c', |
| 1569 | + 'inputs': [ |
| 1570 | + 'tools/js2c.rs', |
| 1571 | + ], |
| 1572 | + 'outputs': [ |
| 1573 | + '<(node_js2c_exec)', |
| 1574 | + ], |
| 1575 | + 'action': [ |
| 1576 | + 'rustc', |
| 1577 | + '<@(node_js2c_rustc_flags)', |
| 1578 | + 'tools/js2c.rs', |
| 1579 | + '-o', |
| 1580 | + '<@(_outputs)', |
| 1581 | + ], |
| 1582 | + }, |
1568 | 1583 | ], |
1569 | 1584 | 'conditions': [ |
1570 | | - [ 'OS=="mac"', { |
1571 | | - 'libraries': [ '-framework CoreFoundation -framework Security' ], |
1572 | | - }], |
1573 | | - [ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', { |
1574 | | - 'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf#host' ], |
1575 | | - }], |
1576 | | - [ 'node_shared_libuv=="false"', { |
1577 | | - 'dependencies': [ 'deps/uv/uv.gyp:libuv#host' ], |
1578 | | - }], |
1579 | 1585 | [ 'OS in "linux mac openharmony"', { |
1580 | | - 'defines': ['NODE_JS2C_USE_STRING_LITERALS'], |
| 1586 | + 'variables': { |
| 1587 | + 'node_js2c_rustc_flags+': [ |
| 1588 | + '--cfg', |
| 1589 | + 'node_js2c_use_string_literals', |
| 1590 | + ], |
| 1591 | + }, |
1581 | 1592 | }], |
1582 | 1593 | [ 'debug_node=="true"', { |
1583 | | - 'cflags!': [ '-O3' ], |
1584 | | - 'cflags': [ '-g', '-O0' ], |
1585 | | - 'defines': [ 'DEBUG' ], |
1586 | | - 'xcode_settings': { |
1587 | | - 'OTHER_CFLAGS': [ |
1588 | | - '-g', '-O0' |
| 1594 | + 'variables': { |
| 1595 | + 'node_js2c_rustc_flags!': [ |
| 1596 | + '-C', |
| 1597 | + 'opt-level=2', |
| 1598 | + ], |
| 1599 | + 'node_js2c_rustc_flags+': [ |
| 1600 | + '-C', |
| 1601 | + 'debuginfo=2', |
| 1602 | + '-C', |
| 1603 | + 'opt-level=0', |
1589 | 1604 | ], |
1590 | 1605 | }, |
1591 | 1606 | }], |
|
0 commit comments