mirror of https://github.com/microsoft/vcpkg.git
[node-api-headers] Fix include path [vcpkg-ci-node-addon-api] New ci port (#52651)
This commit is contained in:
parent
9c89a5f5c3
commit
b5e593a265
|
|
@ -12,7 +12,10 @@ if(VCPKG_TARGET_IS_WINDOWS)
|
|||
vcpkg_cmake_install()
|
||||
endif()
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}/include" RENAME "node")
|
||||
file(INSTALL "${SOURCE_PATH}/include/js_native_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||
file(INSTALL "${SOURCE_PATH}/include/js_native_api_types.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||
file(INSTALL "${SOURCE_PATH}/include/node_api.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||
file(INSTALL "${SOURCE_PATH}/include/node_api_types.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ if(NOT TARGET unofficial::node-api-headers::node-api-headers)
|
|||
add_library(unofficial::node-api-headers::node-api-headers INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
set(node-api-headers_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../include/node)
|
||||
set(node-api-headers_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../include)
|
||||
|
||||
set_target_properties(unofficial::node-api-headers::node-api-headers PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${node-api-headers_INCLUDE_DIR}"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "node-api-headers",
|
||||
"version": "1.9.0",
|
||||
"port-version": 1,
|
||||
"description": "NodeJS API for writing modules in C++",
|
||||
"homepage": "https://nodejs.org/api/addons.html",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(vcpkg-ci-node-addon-api)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
add_definitions(-DNAPI_VERSION=3)
|
||||
|
||||
find_package(unofficial-node-addon-api CONFIG REQUIRED)
|
||||
|
||||
add_library(hello SHARED hello.cpp)
|
||||
set_target_properties(hello PROPERTIES PREFIX "" SUFFIX ".node")
|
||||
target_link_libraries(hello PRIVATE unofficial::node-addon-api::node-addon-api)
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#include <napi.h>
|
||||
|
||||
Napi::String Method(const Napi::CallbackInfo& info) {
|
||||
Napi::Env env = info.Env();
|
||||
return Napi::String::New(env, "world");
|
||||
}
|
||||
|
||||
Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
exports.Set(Napi::String::New(env, "hello"),
|
||||
Napi::Function::New(env, Method));
|
||||
return exports;
|
||||
}
|
||||
|
||||
NODE_API_MODULE(hello, Init)
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "vcpkg-ci-node-addon-api",
|
||||
"version-string": "ci",
|
||||
"description": "Validates node-addon-api",
|
||||
"dependencies": [
|
||||
"node-addon-api",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -7110,7 +7110,7 @@
|
|||
},
|
||||
"node-api-headers": {
|
||||
"baseline": "1.9.0",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"nodesoup": {
|
||||
"baseline": "2023-06-12",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "c932f9cfcc93fbfe7051aa5dfb011a42120149d5",
|
||||
"version": "1.9.0",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "2640aa78164a5df3f5513f113da234ead59b8d2a",
|
||||
"version": "1.9.0",
|
||||
|
|
|
|||
Loading…
Reference in New Issue