• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisión23a132dd4d5ebf8c03b50de3e7d2e955c8f38006 (tree)
Tiempo2017-01-02 11:23:23
Autors.gusarov
Commiters.gusarov

Log Message

New version info generation mechanism

Cambiar Resumen

Diferencia incremental

diff -r c415e873fee1 -r 23a132dd4d5e .hgsubstate
--- a/.hgsubstate Mon Jan 02 05:13:50 2017 +0300
+++ b/.hgsubstate Mon Jan 02 05:23:23 2017 +0300
@@ -1,4 +1,4 @@
11 985ef3f082586ba904dfc648dca417ce0389337d cmake/cmake_tools
22 5013d507802becd2c434d4dbdafad45c3da5ef23 include/ctools/std/msinttypes
3-406ab938b1d534e1ccf7a0fb48fe9760359eba93 pyrepo
3+19863895614c1d2ddaf55b3873effddf39d74c4f pyrepo
44 7f9f937cd195d8667002e010220f46f6909d5cbe tests/unity
diff -r c415e873fee1 -r 23a132dd4d5e CMakeLists.txt
--- a/CMakeLists.txt Mon Jan 02 05:13:50 2017 +0300
+++ b/CMakeLists.txt Mon Jan 02 05:23:23 2017 +0300
@@ -21,8 +21,8 @@
2121 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_tools/tools/python_binary.cmake)
2222
2323 execute_process(COMMAND ${CMT_PYTHON_BINARY} ${CMAKE_CURRENT_LIST_DIR}/pyrepo/gen_buildinfo.py
24- ${CMAKE_CURRENT_LIST_DIR}/buildinfo/include/ctools/version_info.template
25- ${CMAKE_CURRENT_LIST_DIR}/buildinfo/include/ctools/version_info.h)
24+ "CT" ${CMAKE_CURRENT_LIST_DIR}/buildinfo/include/ctools
25+)
2626
2727 if (NOT PROJECT_NAME AND NOT CT_STANDALONE_BUILD)
2828 # Pure CMake build(suitable also for IDE's parsers)
diff -r c415e873fee1 -r 23a132dd4d5e buildinfo/include/ctools/major_version.template
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildinfo/include/ctools/major_version.template Mon Jan 02 05:23:23 2017 +0300
@@ -0,0 +1,1 @@
1+0
\ No newline at end of file
diff -r c415e873fee1 -r 23a132dd4d5e buildinfo/include/ctools/minor_version.template
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildinfo/include/ctools/minor_version.template Mon Jan 02 05:23:23 2017 +0300
@@ -0,0 +1,1 @@
1+1
\ No newline at end of file
diff -r c415e873fee1 -r 23a132dd4d5e buildinfo/include/ctools/version_info.h.template
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildinfo/include/ctools/version_info.h.template Mon Jan 02 05:23:23 2017 +0300
@@ -0,0 +1,25 @@
1+/*
2+ * @author Sergey Gusarov <laborer2008 (at) gmail.com>
3+ * @section LICENSE
4+ * This Source Code Form is subject to the terms of the Mozilla Public
5+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+ *
8+ * @section DESCRIPTION
9+ * This file should be process by C/C++ compilers and MS resource compiler
10+ * Do not edit. Automatically generated file
11+ */
12+
13+#pragma once
14+
15+#include <ctools/std/stdbool.h>
16+#include <ctools/version.h>
17+
18+#define {prefix}_MAJOR_VERSION {major_version}
19+#define {prefix}_MINOR_VERSION {minor_version}
20+
21+#define {prefix}_BUILD_REVISION {rev}
22+#define {prefix}_INTERNAL_BUILD {is_internal}
23+
24+#define {prefix}_K_VERSION\
25+ CT_VER_STR_DOT({prefix}_MAJOR_VERSION, {prefix}_MINOR_VERSION, {prefix}_BUILD_REVISION)
diff -r c415e873fee1 -r 23a132dd4d5e buildinfo/include/ctools/version_info.template
--- a/buildinfo/include/ctools/version_info.template Mon Jan 02 05:13:50 2017 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
1-/*
2- * @author Sergey Gusarov <laborer2008 (at) gmail.com>
3- * @section LICENSE
4- * This Source Code Form is subject to the terms of the Mozilla Public
5- * License, v. 2.0. If a copy of the MPL was not distributed with this
6- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7- *
8- * @section DESCRIPTION
9- * This file should be process by C/C++ compilers and MS resource compiler
10- */
11-
12-#pragma once
13-
14-#include <ctools/std/stdbool.h>
15-
16-
17-#define CT_LIBRARY_NAME "ctools"
18-
19-#define CT_MAJOR_VERSION 0
20-#define CT_MINOR_VERSION 1
21-
22-#define CT_BUILD_REVISION {rev}
23-#define CT_INTERNAL_BUILD {is_internal}
diff -r c415e873fee1 -r 23a132dd4d5e tests/buildinfo/test_version_info.c
--- a/tests/buildinfo/test_version_info.c Mon Jan 02 05:13:50 2017 +0300
+++ b/tests/buildinfo/test_version_info.c Mon Jan 02 05:23:23 2017 +0300
@@ -11,10 +11,9 @@
1111
1212 #include "tests/unity_headers.h"
1313
14+#include <ctools/unused.h>
1415 #include <ctools/version_info.h>
1516
16-#include <ctools/unused.h>
17-
1817
1918 void setUp(void)
2019 {
@@ -26,19 +25,19 @@
2625
2726 void testCompile(void)
2827 {
29- const char* const kLibraryName = CT_LIBRARY_NAME;
30-
3128 const int kMajorVersion = CT_MAJOR_VERSION;
3229 const int kMinorVersion = CT_MINOR_VERSION;
3330 const int kBuildRevision = CT_BUILD_REVISION;
3431
3532 const bool kInternalBuild = CT_INTERNAL_BUILD;
3633
37- CT_UNUSED(kLibraryName);
34+ const char* const kVersion = CT_K_VERSION;
3835
3936 CT_UNUSED(kMajorVersion);
4037 CT_UNUSED(kMinorVersion);
4138 CT_UNUSED(kBuildRevision);
4239
4340 CT_UNUSED(kInternalBuild);
41+
42+ CT_UNUSED(kVersion);
4443 }
Show on old repository browser