File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.0 FATAL_ERROR)
22project (i3ipc++)
33
4+ string (TIMESTAMP I3IPCppBUILD_DATETIME "%Y-%m-%d %H:%M:%S" )
5+
46option (I3IPCpp_WITH_TESTS "Build unit tests executables" OFF )
57option (I3IPCpp_BUILD_EXAMPLES "Build example executables" OFF )
68
@@ -58,6 +60,10 @@ target_compile_options(i3ipc++
5860 PUBLIC -std=c++11 -Wall -Wextra -Wno-unused-parameter
5961)
6062
63+ target_compile_definitions (i3ipc++
64+ PRIVATE I3IPC_BUILD_DATETIME="${I3IPCppBUILD_DATETIME} "
65+ )
66+
6167if (CMAKE_BUILD_TYPE EQUAL "DEBUG" )
6268 target_compile_options (i3ipc++
6369 PUBLIC -g3
Original file line number Diff line number Diff line change @@ -342,6 +342,12 @@ class connection {
342342 const std::string m_socket_path;
343343};
344344
345+ /* *
346+ * Get version of i3ipc++
347+ * @return the version of i3ipc++
348+ */
349+ const version_t & get_version ();
350+
345351}
346352
347353/* *
Original file line number Diff line number Diff line change @@ -553,4 +553,19 @@ int32_t connection::get_main_socket_fd() { return m_main_socket; }
553553
554554int32_t connection::get_event_socket_fd () { return m_event_socket; }
555555
556+
557+ const version_t & get_version () {
558+ #define I3IPC_VERSION_MAJOR 0
559+ #define I3IPC_VERSION_MINOR 3
560+ #define I3IPC_VERSION_PATCH 0
561+ static version_t version = {
562+ .human_readable = auss_t () << I3IPC_VERSION_MAJOR << ' .' << I3IPC_VERSION_MINOR << ' .' << I3IPC_VERSION_PATCH << " (built on " << I3IPC_BUILD_DATETIME << " )" ,
563+ .loaded_config_file_name = std::string (),
564+ .major = I3IPC_VERSION_MAJOR,
565+ .minor = I3IPC_VERSION_MINOR,
566+ .patch = I3IPC_VERSION_PATCH,
567+ };
568+ return version;
569+ }
570+
556571}
You can’t perform that action at this time.
0 commit comments