added scm rev generation on Linux/cmake

This commit is contained in:
bunnei 2014-04-23 18:43:57 -07:00
parent 7a136b8a84
commit 4405a53cf3
10 changed files with 211 additions and 53 deletions

View file

@ -1,3 +1,5 @@
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp" @ONLY)
set(SRCS break_points.cpp
console_listener.cpp
extended_trace.cpp
@ -15,6 +17,6 @@ set(SRCS break_points.cpp
thread.cpp
timer.cpp
utf8.cpp
version.cpp)
${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp)
add_library(common STATIC ${SRCS})

View file

@ -12,10 +12,6 @@
#include <stdio.h>
#include <string.h>
// SVN version number
extern const char *g_scm_rev_str;
extern const char *g_netplay_citra_ver;
// Force enable logging in the right modes. For some reason, something had changed
// so that debugfast no longer logged.
#if defined(_DEBUG) || defined(DEBUGFAST)

View file

@ -5,6 +5,7 @@
#pragma once
#include "common/common.h"
#include "common/scm_rev.h"
// Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL,
// QGLWidget, GLFW, etc...)
@ -66,7 +67,7 @@ public:
protected:
EmuWindow() : m_client_area_width(640), m_client_area_height(480) {
char window_title[255];
sprintf(window_title, "citra-%s", g_scm_rev_str);
sprintf(window_title, "citra-%s", Common::g_scm_desc);
m_window_title = window_title;
}
virtual ~EmuWindow() {}

18
src/common/scm_rev.cpp.in Normal file
View file

@ -0,0 +1,18 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include "common/scm_rev.h"
#define GIT_REV "@GIT_REV@"
#define GIT_REF_SPEC "@GIT_REF_SPEC@"
#define GIT_DESC "@GIT_DESC@"
namespace Common {
const char g_scm_rev[] = GIT_REV;
const char g_scm_ref_spec[] = GIT_REF_SPEC;
const char g_scm_desc[] = GIT_DESC;
} // namespace

14
src/common/scm_rev.h Normal file
View file

@ -0,0 +1,14 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
namespace Common {
extern const char g_scm_rev[];
extern const char g_scm_ref_spec[];
extern const char g_scm_desc[];
} // namespace

View file

@ -1,45 +0,0 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include "common/common.h"
#include "common/scm_rev.h"
#ifdef _DEBUG
#define BUILD_TYPE_STR "Debug "
#elif defined DEBUGFAST
#define BUILD_TYPE_STR "DebugFast "
#else
#define BUILD_TYPE_STR ""
#endif
const char *g_scm_rev_str =
#if !SCM_IS_MASTER
"[" SCM_BRANCH_STR "] "
#endif
#ifdef __INTEL_COMPILER
BUILD_TYPE_STR SCM_DESC_STR "-ICC";
#else
BUILD_TYPE_STR SCM_DESC_STR;
#endif
#ifdef _M_X64
#define NP_ARCH "x64"
#else
#ifdef _M_ARM
#define NP_ARCH "ARM"
#else
#define NP_ARCH "x86"
#endif
#endif
#ifdef _WIN32
const char *g_netplay_citra_ver = SCM_DESC_STR " W" NP_ARCH;
#elif __APPLE__
const char *g_netplay_citra_ver = SCM_DESC_STR " M" NP_ARCH;
#else
const char *g_netplay_citra_ver = SCM_DESC_STR " L" NP_ARCH;
#endif
const char *scm_rev_git_str = SCM_REV_STR;