[icinga-checkins] icinga.org: icinga2/feature/codegen: Avoid rebuilding libbase when the version number changes

git at icinga.org git at icinga.org
Thu Nov 20 11:02:35 CET 2014


Module: icinga2
Branch: feature/codegen
Commit: 6cadde82bd1cc10ea70d8219fe225311ab2da637
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=6cadde82bd1cc10ea70d8219fe225311ab2da637

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Nov 20 09:59:39 2014 +0100

Avoid rebuilding libbase when the version number changes

fixes #7647

---

 lib/base/CMakeLists.txt          |    4 +++-
 lib/base/application-version.cpp |   29 +++++++++++++++++++++++++++++
 lib/base/application.cpp         |    6 ------
 3 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt
index b8bc728..57e051a 100644
--- a/lib/base/CMakeLists.txt
+++ b/lib/base/CMakeLists.txt
@@ -23,7 +23,7 @@ mkclass_target(streamlogger.ti streamlogger.thpp)
 mkclass_target(sysloglogger.ti sysloglogger.thpp)
 
 set(base_SOURCES
-  application.cpp application.thpp array.cpp configerror.cpp console.cpp context.cpp
+  application.cpp application-version.cpp application.thpp array.cpp configerror.cpp console.cpp context.cpp
   convert.cpp debuginfo.cpp dictionary.cpp dynamicobject.cpp dynamicobject.thpp dynamictype.cpp
   exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp logger.cpp logger.thpp
   netstring.cpp networkstream.cpp object.cpp primitivetype.cpp process.cpp
@@ -35,6 +35,8 @@ set(base_SOURCES
   value-operators.cpp workqueue.cpp
 )
 
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
+
 if(ICINGA2_UNITY_BUILD)
     mkunity_target(base base_SOURCES)
 endif()
diff --git a/lib/base/application-version.cpp b/lib/base/application-version.cpp
new file mode 100644
index 0000000..e670321
--- /dev/null
+++ b/lib/base/application-version.cpp
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)    *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+#include "base/application.hpp"
+#include "icinga-version.h"
+
+using namespace icinga;
+
+String Application::GetVersion(void)
+{
+	return VERSION;
+}
+
diff --git a/lib/base/application.cpp b/lib/base/application.cpp
index 6e489d3..3df75b5 100644
--- a/lib/base/application.cpp
+++ b/lib/base/application.cpp
@@ -29,7 +29,6 @@
 #include "base/convert.hpp"
 #include "base/scriptvariable.hpp"
 #include "base/process.hpp"
-#include "icinga-version.h"
 #include <sstream>
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/foreach.hpp>
@@ -1161,11 +1160,6 @@ ThreadPool& Application::GetTP(void)
 	return tp;
 }
 
-String Application::GetVersion(void)
-{
-	return VERSION;
-}
-
 double Application::GetStartTime(void)
 {
 	return m_StartTime;



More information about the icinga-checkins mailing list