diff options
author | Max Horn | 2010-08-11 12:50:18 +0000 |
---|---|---|
committer | Max Horn | 2010-08-11 12:50:18 +0000 |
commit | 1b1044437716dd0f4dc1e591ba8f442fd85911e1 (patch) | |
tree | 1ce0116bcfc86b9b97a3a6a4cd959dcf52fc9f78 | |
parent | 01c8e02e60530b70dba26cdaf707710aa41f94c7 (diff) | |
download | scummvm-rg350-1b1044437716dd0f4dc1e591ba8f442fd85911e1.tar.gz scummvm-rg350-1b1044437716dd0f4dc1e591ba8f442fd85911e1.tar.bz2 scummvm-rg350-1b1044437716dd0f4dc1e591ba8f442fd85911e1.zip |
BUILD: Limit scope of SCUMMVM_SVN_REVISION and SCUMMVM_VERSION macros
Only #define SCUMMVM_SVN_REVISION for base/version.cpp (at most), to
avoid having all source files implicitly depend on the SVN revision.
Also add a safeguard to prevent code from accidentally using the
internal header file base/internal_version.h.
svn-id: r51978
-rw-r--r-- | Makefile.common | 5 | ||||
-rw-r--r-- | base/internal_version.h | 4 | ||||
-rw-r--r-- | base/internal_version.h.in | 4 | ||||
-rw-r--r-- | base/version.cpp | 4 |
4 files changed, 13 insertions, 4 deletions
diff --git a/Makefile.common b/Makefile.common index f8b758b4ba..4a11fafa0f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -172,12 +172,11 @@ SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/ endif # Define the Subversion revision if available, either autodetected or -# specified by the user +# specified by the user, but only for base/version.cpp. ifneq ($(origin VER_SVNREV), undefined) -CXXFLAGS+= -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\" +base/version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\" endif - ###################################################################### # Distribution settings ###################################################################### diff --git a/base/internal_version.h b/base/internal_version.h index 2e6b7a24ad..5fd0535142 100644 --- a/base/internal_version.h +++ b/base/internal_version.h @@ -1,3 +1,7 @@ +#ifndef INCLUDED_FROM_BASE_VERSION_CPP +#error This file may only be included by base/version.cpp +#endif + #ifndef SCUMMVM_SVN_REVISION #define SCUMMVM_SVN_REVISION #endif diff --git a/base/internal_version.h.in b/base/internal_version.h.in index 4eecf90d87..adf5f94d21 100644 --- a/base/internal_version.h.in +++ b/base/internal_version.h.in @@ -1,3 +1,7 @@ +#ifndef INCLUDED_FROM_BASE_VERSION_CPP +#error This file may only be included by base/version.cpp +#endif + #ifndef SCUMMVM_SVN_REVISION #define SCUMMVM_SVN_REVISION #endif diff --git a/base/version.cpp b/base/version.cpp index 17058d4a03..055067a656 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -24,9 +24,11 @@ */ #include "common/scummsys.h" -#include "base/internal_version.h" #include "base/version.h" +#define INCLUDED_FROM_BASE_VERSION_CPP +#include "base/internal_version.h" + /* * Version string and build date string. These can be used by anything that * wants to display this information to the user (e.g. about dialog). |