Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Provide def file for windows import lib #15

Copy link
Copy link
@Pospelove

Description

@Pospelove
Issue body actions

required for microsoft/vcpkg#29743

this can be done during sync-headers processing
https://github.com/nodejs/node-api-headers/blob/main/.github/workflows/sync-headers.yml

the following code may be used to generate .def file

// https://github.com/cmake-js/cmake-js/blob/e2452ee226490bc666d286ab0860aeb35fbbb035/lib/cMake.js#L293

const headers = require('.');

// Compile a Set of all the symbols that could be exported
const allSymbols = new Set()
for (const ver of Object.values(headers.symbols)) {
    for (const sym of ver.node_api_symbols) {
        allSymbols.add(sym)
    }
    for (const sym of ver.js_native_api_symbols) {
        allSymbols.add(sym)
    }
}

// Write a 'def' file for NODE.EXE
const allSymbolsArr = Array.from(allSymbols)
require('fs').writeFileSync("./node.def", 'NAME NODE.EXE\nEXPORTS\n' + allSymbolsArr.join('\n'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.