Skip to content

Commit a2a5185

Browse files
print library versions with option --longversion
1 parent 9f8d5f0 commit a2a5185

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
#include <atomic>
1313
#include <condition_variable>
1414
#include <csignal>
15+
#include <cxxsemaphore_version_info.hpp>
16+
#include <cxxshm_version_info.hpp>
1517
#include <filesystem>
1618
#include <iostream>
19+
#include <modbus/modbus-version.h>
1720
#include <sys/ioctl.h>
1821
#include <sys/resource.h>
1922
#include <sys/signalfd.h>
@@ -254,6 +257,23 @@ int main(int argc, char **argv) {
254257
#endif
255258
<< '\n';
256259
std::cout << " from git commit " << RCS_HASH << '\n';
260+
261+
std::cout << "Libraries:\n";
262+
263+
std::cout << " " << cxxshm_version_info::NAME << ' ' << cxxshm_version_info::VERSION_STR << '\n';
264+
std::cout << " compiled with " << cxxshm_version_info::COMPILER << '\n';
265+
std::cout << " on system " << cxxshm_version_info::SYSTEM << '\n';
266+
std::cout << " from git commit " << cxxshm_version_info::GIT_HASH << '\n';
267+
268+
std::cout << " " << cxxsemaphore_version_info::NAME << ' ' << cxxsemaphore_version_info::VERSION_STR << '\n';
269+
std::cout << " compiled with " << cxxsemaphore_version_info::COMPILER << '\n';
270+
std::cout << " on system " << cxxsemaphore_version_info::SYSTEM << '\n';
271+
std::cout << " from git commit " << cxxsemaphore_version_info::GIT_HASH << '\n';
272+
273+
std::cout << " libmodbus " << LIBMODBUS_VERSION_STRING << '\n';
274+
275+
std::cout << " cxxopts " << static_cast<int>(cxxopts::version.major) << '.' << static_cast<int>(cxxopts::version.minor) << '.' << static_cast<int>(cxxopts::version.patch) << '\n';
276+
257277
return EX_OK;
258278
}
259279

0 commit comments

Comments
 (0)