Summary
The host version is a compile-time string literal at the top of cpp/host/dispatch.cpp:
static constexpr const char* kHostVersion = "1.0.0";
This version is shown in /version, /debug, and debug.version IPC responses. It is not tied to any build system variable, CMake version, or git tag. This means the version shown to users is only updated when someone manually edits this constant, and it is easy to ship a build with a stale version number.
How to fix
Define the version in CMakeLists.txt using project(Binder VERSION 1.2.3) and pass it to the compilation unit via a preprocessor definition:
target_compile_definitions(binder_host PRIVATE
BINDER_VERSION="${CMAKE_PROJECT_VERSION}"
)
Then in dispatch.cpp:
static constexpr const char* kHostVersion = BINDER_VERSION;
Alternatively, generate a version.hpp header from CMake using configure_file.
Files
cpp/host/dispatch.cpp (line 47, kHostVersion constant)
cpp/CMakeLists.txt (add version propagation)
Summary
The host version is a compile-time string literal at the top of
cpp/host/dispatch.cpp:This version is shown in
/version,/debug, anddebug.versionIPC responses. It is not tied to any build system variable, CMake version, or git tag. This means the version shown to users is only updated when someone manually edits this constant, and it is easy to ship a build with a stale version number.How to fix
Define the version in
CMakeLists.txtusingproject(Binder VERSION 1.2.3)and pass it to the compilation unit via a preprocessor definition:Then in
dispatch.cpp:Alternatively, generate a
version.hppheader from CMake usingconfigure_file.Files
cpp/host/dispatch.cpp(line 47,kHostVersionconstant)cpp/CMakeLists.txt(add version propagation)