From: Gunnar Beutner Date: Thu, 20 Nov 2014 08:59:39 +0000 (+0100) Subject: Avoid rebuilding libbase when the version number changes X-Git-Tag: v2.3.0~661 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cadde82bd1cc10ea70d8219fe225311ab2da637;p=icinga2 Avoid rebuilding libbase when the version number changes fixes #7647 --- diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt index b8bc72888..57e051a6e 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 000000000..e67032184 --- /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 6e489d3ef..3df75b5a5 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 #include #include @@ -1161,11 +1160,6 @@ ThreadPool& Application::GetTP(void) return tp; } -String Application::GetVersion(void) -{ - return VERSION; -} - double Application::GetStartTime(void) { return m_StartTime;