nodejs / nodejs/node-gyp

How to compile static library target in simulator

Open
#3,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.7k
Forks
1.9k
Avg merge
1d 4h
Merged PRs (30d)
5

Description

I need to have the simdutf target compiled by my implementation to support the new instructions. That is, add my simulator path before the gcc/g++ command to compile this object.

{
   'variables': {
     'simdutf_sources': [
     'simdutf.cpp',
     ]
   },
   'targets': [
     {
         'target_name': 'simdutf',
         'toolsets': ['host', 'target'],
         'type': 'static_library',
         'include_dirs': ['.'],
         'direct_dependent_settings': {
         'include_dirs': ['.'],
     },
     'sources': [
         '<@(simdutf_sources)',
         ],
     },
   ]
}

If it is an action, I can use the following method to add the path of my simulator before '<(node_js2c_exec)', but for a static library target, I don't know how to modify it.

   'actions': [
   {
     'action_name': 'node_js2c',
     'process_outputs_as_sources': 1,
     'inputs': [
         '<(node_js2c_exec)',
         '<@(library_files)',
         '<@(deps_files)',
         'config.gypi'
      ],
     'outputs': [
       '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
       ],
     'action': [
         'my_simulator_path',
         '<(node_js2c_exec)',
         '<@(_outputs)',
         'lib',
         'config.gypi',
         '<@(deps_files)',
         '<@(linked_module_files)',
     ],

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GYP static_library target and actions example shown in the issue. No repository file or test is identified, so first determine whether node-gyp should document this configuration or change its build behavior; completion would require a defined expected workflow and corresponding documentation or verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, nodejs
Domain
build-system
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.