Skip to content

Commit

Permalink
[xnnpack] update xnnpack-config.cmake template
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Jan 20, 2024
1 parent c28e061 commit 4504584
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/xnnpack/fix-cmake.patch
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ index 2e7f753..b33f03d 100644
+ include(CMakePackageConfigHelpers)
+ get_filename_component(CONFIG_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/xnnpack-config.cmake ABSOLUTE)
+ configure_package_config_file(
+ cmake/xnnpack-config.cmake.in ${CONFIG_FILE_PATH}
+ cmake/xnnpack-config.template.cmake ${CONFIG_FILE_PATH}
+ INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR})
+ install(FILES ${CONFIG_FILE_PATH} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) # ${prefix}/share
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion ports/xnnpack/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vcpkg_from_github(
PATCHES
fix-cmake.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/xnnpack-config.cmake.in" DESTINATION "${SOURCE_PATH}/cmake")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/xnnpack-config.template.cmake" DESTINATION "${SOURCE_PATH}/cmake")

if(VCPKG_TARGET_IS_WINDOWS)
# Visual Studio generator may required for CMake to detect ASM compiler
Expand Down
1 change: 1 addition & 0 deletions ports/xnnpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "xnnpack",
"version-date": "2023-11-16",
"port-version": 1,
"description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web",
"homepage": "https://github.com/google/XNNPACK",
"dependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(Z_XNNPACK_CONFIG_GUARD ON CACHE INTERNAL "Guard variable for 'xnnpack-config
# from vcpkg, luncliff/vcpkg-registry
if(NOT DEFINED PTHREADPOOL_LIBRARY)
find_library(PTHREADPOOL_LIBRARY NAMES pthreadpool REQUIRED)
get_filename_component(PTHREADPOOL_LIBRARY_DIR "${PTHREADPOOL_LIBRARY}" PATH)
endif()
if(NOT TARGET cpuinfo::cpuinfo)
find_package(cpuinfo CONFIG REQUIRED) # cpuinfo::cpuinfo
Expand All @@ -30,3 +31,10 @@ PROPERTIES
INTERFACE_LINK_LIBRARIES "${PTHREADPOOL_LIBRARY};cpuinfo::cpuinfo"
IMPORTED_LOCATION "${XNNPACK_LIBRARY}"
)

if(DEFINED PTHREADPOOL_LIBRARY_DIR)
set_target_properties(xnnpack
PROPERTIES
INTERFACE_LINK_DIRECTORIES "${PTHREADPOOL_LIBRARY_DIR}"
)
endif()
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
},
"xnnpack": {
"baseline": "2023-11-16",
"port-version": 0
"port-version": 1
},
"xnvctrl": {
"baseline": "515.43.04",
Expand Down
5 changes: 5 additions & 0 deletions versions/x-/xnnpack.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aecceb96b304a04bc6c0345aed0dbbc0e8817788",
"version-date": "2023-11-16",
"port-version": 1
},
{
"git-tree": "d58562afb8e0b1db84098fa360d77c70086c9d81",
"version-date": "2023-11-16",
Expand Down

0 comments on commit 4504584

Please sign in to comment.