Set `CMAKE_JS_NODELIB_DEF` and `CMAKE_JS_NODELIB_TARGET`

Open
#248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cmake
Domain
build-system

Research direction

Start with the CMakeLists.txt snippet in the issue and inspect lib/cMake.js around line 220, where CMAKE_JS_LIB is exposed to the CMake project. Trace how cmake-js currently handles CMAKE_JS_NODELIB_DEF and CMAKE_JS_NODELIB_TARGET, then determine the expected behavior for setting them and verify it in the relevant build path.

Written by the indexing model from the issue text.

Description

CMake RN enhancement

Users of cmake-js are instructed to add the following to their CMakeLists.txt

if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
  # Generate node.lib
  execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
endif()

Which will generate a node.lib file exposed to the CMake project via CMAKE_JS_LIB.

Dominant language
TypeScript
Stars
206
Forks
12
Avg merge
4h 8m
Merged PRs (30d)
2

Getting set up

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.

More from callstackincubator/react-native-node-api

All issues in callstackincubator/react-native-node-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.