CMake
- improve compilation by removing the git sha1 dependency into its own include file that is just used 2 times instead of auto.h that is included in more places.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@ install_manifest.txt
|
|||||||
_CPack_Packages
|
_CPack_Packages
|
||||||
CPackConfig.cmake
|
CPackConfig.cmake
|
||||||
CPackSourceConfig.cmake
|
CPackSourceConfig.cmake
|
||||||
|
commit.h
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ if (EXISTS .git/index)
|
|||||||
set (HAVE_COMMIT true)
|
set (HAVE_COMMIT true)
|
||||||
execute_process (COMMAND git log -1 --pretty=format:%h
|
execute_process (COMMAND git log -1 --pretty=format:%h
|
||||||
OUTPUT_VARIABLE COMMIT)
|
OUTPUT_VARIABLE COMMIT)
|
||||||
|
configure_file ( ${CMAKE_SOURCE_DIR}/commit.h.in
|
||||||
|
${CMAKE_SOURCE_DIR}/commit.h)
|
||||||
message ("-- Found SHA1 reference: ${COMMIT}")
|
message ("-- Found SHA1 reference: ${COMMIT}")
|
||||||
endif (EXISTS .git/index)
|
endif (EXISTS .git/index)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
/* git information */
|
/* git information */
|
||||||
#cmakedefine HAVE_COMMIT
|
#cmakedefine HAVE_COMMIT
|
||||||
#define COMMIT "${COMMIT}"
|
|
||||||
|
|
||||||
/* Compiling platform */
|
/* Compiling platform */
|
||||||
#cmakedefine LINUX
|
#cmakedefine LINUX
|
||||||
|
|||||||
4
commit.h.in
Normal file
4
commit.h.in
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/* commit.h.in. Creates commit.h during a cmake run */
|
||||||
|
|
||||||
|
/* git information */
|
||||||
|
#define COMMIT "${COMMIT}"
|
||||||
@@ -42,8 +42,11 @@
|
|||||||
#include "text.h"
|
#include "text.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "../auto.h"
|
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
#include "../auto.h"
|
||||||
|
#ifdef HAVE_COMMIT
|
||||||
|
#include "../commit.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@
|
|||||||
#include <main.h>
|
#include <main.h>
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include "../auto.h"
|
#include "../auto.h"
|
||||||
|
#ifdef HAVE_COMMIT
|
||||||
|
#include "../commit.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBLUA
|
#ifdef HAVE_LIBLUA
|
||||||
extern "C"
|
extern "C"
|
||||||
|
|||||||
Reference in New Issue
Block a user