Skip to content

Commit

Permalink
IGNITE-22660 Add meta info to ODBC dll (apache#4768)
Browse files Browse the repository at this point in the history
  • Loading branch information
isapego authored Nov 21, 2024
1 parent c4184eb commit 7b99d63
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ build/
*.ipr
out/

modules/platforms/cpp/cmake-build-*

# JVM crash dumps
**/hs_err_pid*

Expand Down
1 change: 1 addition & 0 deletions modules/platforms/cpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake-build-*
18 changes: 13 additions & 5 deletions modules/platforms/cpp/ignite/odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ set(SOURCES
log.cpp
)

set(EXTRA_FILES)

if (WIN32)
string(REPLACE "." "," CMAKE_PROJECT_VERSION_COMMAS ${CMAKE_PROJECT_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
set(EXTRA_FILES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()

add_compile_definitions(CMAKE_PROJECT_VERSION="${CMAKE_PROJECT_VERSION}")

add_library(${TARGET}-obj OBJECT ${SOURCES})
target_include_directories(${TARGET}-obj PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${ODBC_INCLUDE_DIRS})

add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-obj> module.def)
add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-obj> module.def ${EXTRA_FILES})

set(LIBRARIES
ignite-common
Expand Down Expand Up @@ -93,10 +101,10 @@ unset(_target_libs)

if (${INSTALL_IGNITE_FILES})
install(TARGETS ${TARGET}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
endif()

ignite_test(connection_info_test DISCOVER SOURCES config/connection_info_test.cpp LIBS ${TARGET}-obj ${LIBRARIES})
Expand Down
47 changes: 47 additions & 0 deletions modules/platforms/cpp/ignite/odbc/version.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <windows.h>

#define VER_COMPANYNAME_STR "The Apache Software Foundation"
#define VER_FILEDESCRIPTION_STR "The ODBC Driver for Apache Ignite 3"
#define VER_PRODUCTNAME_STR "The Apache Ignite 3"

#define VER_FILEVERSION @CMAKE_PROJECT_VERSION_COMMAS@,0
#define VER_FILEVERSION_STR "@[email protected]\0"

#define VER_PRODUCTVERSION @CMAKE_PROJECT_VERSION_COMMAS@,0
#define VER_PRODUCTVERSION_STR "@CMAKE_PROJECT_VERSION@\0"

#define VER_INTERNALNAME_STR "@PROJECT_NAME@"
#define VER_ORIGINALFILENAME_STR "@[email protected]"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END

BLOCK "VarFileInfo"
BEGIN
// The following line should only be modified for localized versions. It consists of any number of WORDs,
// WORD pairs, with each pair describing a language, codepage combination supported by the file.
//
// Current values "0x409,1252" indicating that it supports English language (0x409) in the Windows ANSI
// codepage (1252).
VALUE "Translation", 0x409, 1252
END
END

0 comments on commit 7b99d63

Please sign in to comment.