]> granicus.if.org Git - icinga2/commitdiff
Avoid rebuilding libbase when the version number changes
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 20 Nov 2014 08:59:39 +0000 (09:59 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 20 Nov 2014 09:02:34 +0000 (10:02 +0100)
fixes #7647

lib/base/CMakeLists.txt
lib/base/application-version.cpp [new file with mode: 0644]
lib/base/application.cpp

index b8bc72888b41e736c30cf698fb3846b366f64ea6..57e051a6e11e8da079c59d6468579c14b4a2aced 100644 (file)
@@ -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 (file)
index 0000000..e670321
--- /dev/null
@@ -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;
+}
+
index 6e489d3efd38f9a61ff7162d6b5221ae6b58ba0c..3df75b5a516834a3b95e40439ceb4ebc6a37d768 100644 (file)
@@ -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;