Skip to content

Commit ae28303

Browse files
xhan65Copilot
authored andcommitted
Add PE version info to onnxruntime_providers_vitisai.dll (#27626)
### Description Add a Windows VERSIONINFO resource (.rc file) for the Vitis AI provider DLL, following the same pattern used for CUDA, TensorRT, and QNN EPs (added in #24606). This embeds the ORT version into the DLL's PE header so it shows up in file properties. ### Motivation and Context Need version in onnxruntime_providers_vitisai.dll to track changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e55ad52 commit ae28303

2 files changed

Lines changed: 56 additions & 1 deletion

File tree

cmake/onnxruntime_providers_vitisai.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@
1919
"${ONNXRUNTIME_ROOT}/core/providers/shared_library/*.cc"
2020
)
2121
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_vitisai_cc_srcs})
22-
onnxruntime_add_shared_library(onnxruntime_providers_vitisai ${onnxruntime_providers_vitisai_cc_srcs})
22+
set(onnxruntime_providers_vitisai_all_srcs ${onnxruntime_providers_vitisai_cc_srcs})
23+
if(WIN32)
24+
# Sets the DLL version info on Windows: https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
25+
list(APPEND onnxruntime_providers_vitisai_all_srcs "${ONNXRUNTIME_ROOT}/core/providers/vitisai/onnxruntime_providers_vitisai.rc")
26+
endif()
27+
onnxruntime_add_shared_library(onnxruntime_providers_vitisai ${onnxruntime_providers_vitisai_all_srcs})
28+
if(WIN32)
29+
# FILE_NAME preprocessor definition is used in onnxruntime_providers_vitisai.rc
30+
target_compile_definitions(onnxruntime_providers_vitisai PRIVATE FILE_NAME=\"onnxruntime_providers_vitisai.dll\")
31+
endif()
2332
onnxruntime_add_include_to_target(onnxruntime_providers_vitisai ${ONNXRUNTIME_PROVIDERS_SHARED} ${GSL_TARGET} safeint_interface flatbuffers::flatbuffers Boost::mp11)
2433
target_link_libraries(onnxruntime_providers_vitisai PRIVATE ${ONNXRUNTIME_PROVIDERS_SHARED} ${ABSEIL_LIBS})
2534
if(MSVC)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
// This file REQUIRES the following external definitions:
5+
// FILE_NAME, VER_MAJOR, VER_MINOR, VER_BUILD, VER_PRIVATE, and VER_STRING
6+
7+
#include <Winver.h>
8+
9+
#if defined(DEBUG) || defined(_DEBUG)
10+
#define VER_DEBUG VS_FF_DEBUG
11+
#else
12+
#define VER_DEBUG 0
13+
#endif
14+
15+
// -----------------------------------------------------------------------------
16+
17+
VS_VERSION_INFO VERSIONINFO
18+
FILEVERSION VER_MAJOR, VER_MINOR, VER_BUILD, VER_PRIVATE
19+
PRODUCTVERSION VER_MAJOR, VER_MINOR, VER_BUILD, VER_PRIVATE
20+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
21+
FILEFLAGS VER_DEBUG
22+
FILEOS VOS__WINDOWS32
23+
FILETYPE VFT_DLL
24+
FILESUBTYPE VFT2_UNKNOWN
25+
26+
BEGIN
27+
BLOCK "StringFileInfo"
28+
BEGIN
29+
BLOCK "040904E4"
30+
BEGIN
31+
VALUE "CompanyName", "Microsoft Corporation"
32+
VALUE "FileDescription", "ONNX Runtime VitisAI Provider"
33+
VALUE "FileVersion", VER_STRING
34+
VALUE "InternalName", "ONNX Runtime VitisAI Provider"
35+
VALUE "LegalCopyright", "\251 Microsoft Corporation. All rights reserved."
36+
VALUE "OriginalFilename", FILE_NAME
37+
VALUE "ProductName", "Microsoft\256 Windows\256 Operating System"
38+
VALUE "ProductVersion", VER_STRING
39+
END
40+
END
41+
42+
BLOCK "VarFileInfo"
43+
BEGIN
44+
VALUE "Translation", 0x409, 1252
45+
END
46+
END

0 commit comments

Comments
 (0)