diff --git a/.devcontainer b/.devcontainer index 57229e338..c1d4dd32b 160000 --- a/.devcontainer +++ b/.devcontainer @@ -1 +1 @@ -Subproject commit 57229e33846c3e7a6551fc586caed80b8b213cb8 +Subproject commit c1d4dd32b9fddc87e13e5290be8eedc87cfe6a6e diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml index fb5575822..8d2fdecb6 100644 --- a/.github/workflows/xpbuild.yml +++ b/.github/workflows/xpbuild.yml @@ -1,4 +1,7 @@ name: Build +permissions: + contents: read + pull-requests: write on: push: branches: [ "dev" ] @@ -7,24 +10,21 @@ on: workflow_dispatch: jobs: linux: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 + permissions: + contents: read + pull-requests: write + packages: write + uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.3 with: cmake-workflow-preset: LinuxRelease - runon: ubuntu-latest - secrets: inherit - linux-arm64: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1 - with: - cmake-workflow-preset: LinuxRelease - runon: ubuntu-24.04-arm secrets: inherit macos: - uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.1 + uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.3 with: cmake-workflow-preset: DarwinRelease secrets: inherit windows: - uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.1 + uses: externpro/externpro/.github/workflows/build-windows.yml@25.07.3 with: cmake-workflow-preset: WindowsRelease secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml index f868a82e5..86b6f88b5 100644 --- a/.github/workflows/xprelease.yml +++ b/.github/workflows/xprelease.yml @@ -9,10 +9,9 @@ on: jobs: # Upload build artifacts as release assets release-from-build: - uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.1 + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.3 with: workflow_run_url: ${{ github.event.inputs.workflow_run_url }} - artifact_pattern: "*.tar.xz" permissions: contents: write id-token: write diff --git a/CMakeLists.txt b/CMakeLists.txt index e76c68a25..66993030b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,22 @@ cmake_minimum_required(VERSION 3.31) set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) project(node-addon-api VERSION 8.5.0) -include(xpflags) -include(GNUInstallDirs) -set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) # xpPackageDevel -set(XP_NAMESPACE xpro) set(targetsFile ${PROJECT_NAME}-targets) set(lib_name ${PROJECT_NAME}) xpFindPkg(PKGS nodexp) -xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS nodexp LIBRARIES ${XP_NAMESPACE}::${lib_name}) +if(DEFINED XP_NAMESPACE) + xpExternPackage(NAMESPACE ${XP_NAMESPACE} + TARGETS_FILE ${targetsFile} LIBRARIES ${lib_name} + BASE v${CMAKE_PROJECT_VERSION} XPDIFF "intro" DEPS nodexp + WEB "https://github.com/nodejs/node-addon-api" UPSTREAM "github.com/nodejs/node-addon-api" + DESC "Module for using N-API from C++" + LICENSE "[MIT](https://github.com/nodejs/node-addon-api/blob/v8.5.0/LICENSE.md 'MIT License')" + ) + set(CMAKE_INSTALL_CMAKEDIR ${XP_INSTALL_CMAKEDIR}) + set(nameSpace NAMESPACE ${XP_NAMESPACE}::) +elseif(NOT DEFINED CMAKE_INSTALL_CMAKEDIR) + set(CMAKE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +endif() ######################################## set(libsrcs napi-inl.deprecated.h @@ -19,10 +27,10 @@ set(libsrcs add_library(${lib_name} INTERFACE ${libsrcs}) target_include_directories(${lib_name} INTERFACE $) target_compile_definitions(${lib_name} INTERFACE NODE_ADDON_API_DISABLE_DEPRECATED NAPI_CPP_EXCEPTIONS) -target_link_libraries(${lib_name} INTERFACE ${XP_NAMESPACE}::node) +target_link_libraries(${lib_name} INTERFACE ${NODEXP_LIBRARIES}) ######################################## install(TARGETS ${lib_name} EXPORT ${targetsFile}) install(FILES ${libsrcs} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) -install(EXPORT ${targetsFile} DESTINATION ${XP_INSTALL_CMAKEDIR} NAMESPACE ${XP_NAMESPACE}::) +install(EXPORT ${targetsFile} DESTINATION ${CMAKE_INSTALL_CMAKEDIR} ${nameSpace}) install(FILES CHANGELOG.md LICENSE.md README.md DESTINATION ${CMAKE_INSTALL_DATADIR}) install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DATADIR}) diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json index 09653d8ae..4489d79c3 100644 --- a/CMakePresetsBase.json +++ b/CMakePresetsBase.json @@ -4,7 +4,16 @@ { "name": "config-base", "hidden": true, - "binaryDir": "${sourceDir}/_bld-${presetName}" + "binaryDir": "${sourceDir}/_bld-${presetName}", + "cacheVariables": { + "XP_NAMESPACE": "xpro" + } + } + ], + "buildPresets": [ + { + "name": "build-base", + "hidden": true } ] }