diff options
| author | 2014-04-23 18:43:57 -0700 | |
|---|---|---|
| committer | 2014-04-23 18:43:57 -0700 | |
| commit | 4405a53cf3b669e84b1d953d35e89ec29b916293 (patch) | |
| tree | f6d4370cfce75d9922e75d99c82e1935c6b723c9 /src/common | |
| parent | fixes to build on linux (diff) | |
| download | yuzu-4405a53cf3b669e84b1d953d35e89ec29b916293.tar.gz yuzu-4405a53cf3b669e84b1d953d35e89ec29b916293.tar.xz yuzu-4405a53cf3b669e84b1d953d35e89ec29b916293.zip | |
added scm rev generation on Linux/cmake
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/common/common.h | 4 | ||||
| -rw-r--r-- | src/common/emu_window.h | 3 | ||||
| -rw-r--r-- | src/common/scm_rev.cpp.in | 18 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 14 | ||||
| -rw-r--r-- | src/common/version.cpp | 45 |
6 files changed, 37 insertions, 51 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 738144927..1495e433b 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp" @ONLY) | ||
| 2 | |||
| 1 | set(SRCS break_points.cpp | 3 | set(SRCS break_points.cpp |
| 2 | console_listener.cpp | 4 | console_listener.cpp |
| 3 | extended_trace.cpp | 5 | extended_trace.cpp |
| @@ -15,6 +17,6 @@ set(SRCS break_points.cpp | |||
| 15 | thread.cpp | 17 | thread.cpp |
| 16 | timer.cpp | 18 | timer.cpp |
| 17 | utf8.cpp | 19 | utf8.cpp |
| 18 | version.cpp) | 20 | ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp) |
| 19 | 21 | ||
| 20 | add_library(common STATIC ${SRCS}) | 22 | add_library(common STATIC ${SRCS}) |
diff --git a/src/common/common.h b/src/common/common.h index 64a0d7812..a281b21cc 100644 --- a/src/common/common.h +++ b/src/common/common.h | |||
| @@ -12,10 +12,6 @@ | |||
| 12 | #include <stdio.h> | 12 | #include <stdio.h> |
| 13 | #include <string.h> | 13 | #include <string.h> |
| 14 | 14 | ||
| 15 | // SVN version number | ||
| 16 | extern const char *g_scm_rev_str; | ||
| 17 | extern const char *g_netplay_citra_ver; | ||
| 18 | |||
| 19 | // Force enable logging in the right modes. For some reason, something had changed | 15 | // Force enable logging in the right modes. For some reason, something had changed |
| 20 | // so that debugfast no longer logged. | 16 | // so that debugfast no longer logged. |
| 21 | #if defined(_DEBUG) || defined(DEBUGFAST) | 17 | #if defined(_DEBUG) || defined(DEBUGFAST) |
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index e70b99ec1..c53d6d7a2 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/common.h" | 7 | #include "common/common.h" |
| 8 | #include "common/scm_rev.h" | ||
| 8 | 9 | ||
| 9 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, | 10 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, |
| 10 | // QGLWidget, GLFW, etc...) | 11 | // QGLWidget, GLFW, etc...) |
| @@ -66,7 +67,7 @@ public: | |||
| 66 | protected: | 67 | protected: |
| 67 | EmuWindow() : m_client_area_width(640), m_client_area_height(480) { | 68 | EmuWindow() : m_client_area_width(640), m_client_area_height(480) { |
| 68 | char window_title[255]; | 69 | char window_title[255]; |
| 69 | sprintf(window_title, "citra-%s", g_scm_rev_str); | 70 | sprintf(window_title, "citra-%s", Common::g_scm_desc); |
| 70 | m_window_title = window_title; | 71 | m_window_title = window_title; |
| 71 | } | 72 | } |
| 72 | virtual ~EmuWindow() {} | 73 | virtual ~EmuWindow() {} |
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in new file mode 100644 index 000000000..9e2bcfdd8 --- /dev/null +++ b/src/common/scm_rev.cpp.in | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/scm_rev.h" | ||
| 6 | |||
| 7 | #define GIT_REV "@GIT_REV@" | ||
| 8 | #define GIT_REF_SPEC "@GIT_REF_SPEC@" | ||
| 9 | #define GIT_DESC "@GIT_DESC@" | ||
| 10 | |||
| 11 | namespace Common { | ||
| 12 | |||
| 13 | const char g_scm_rev[] = GIT_REV; | ||
| 14 | const char g_scm_ref_spec[] = GIT_REF_SPEC; | ||
| 15 | const char g_scm_desc[] = GIT_DESC; | ||
| 16 | |||
| 17 | } // namespace | ||
| 18 | |||
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h new file mode 100644 index 000000000..7f5ce119c --- /dev/null +++ b/src/common/scm_rev.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | namespace Common { | ||
| 8 | |||
| 9 | extern const char g_scm_rev[]; | ||
| 10 | extern const char g_scm_ref_spec[]; | ||
| 11 | extern const char g_scm_desc[]; | ||
| 12 | |||
| 13 | } // namespace | ||
| 14 | |||
diff --git a/src/common/version.cpp b/src/common/version.cpp deleted file mode 100644 index 2e0c7390c..000000000 --- a/src/common/version.cpp +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/common.h" | ||
| 6 | #include "common/scm_rev.h" | ||
| 7 | |||
| 8 | #ifdef _DEBUG | ||
| 9 | #define BUILD_TYPE_STR "Debug " | ||
| 10 | #elif defined DEBUGFAST | ||
| 11 | #define BUILD_TYPE_STR "DebugFast " | ||
| 12 | #else | ||
| 13 | #define BUILD_TYPE_STR "" | ||
| 14 | #endif | ||
| 15 | |||
| 16 | const char *g_scm_rev_str = | ||
| 17 | #if !SCM_IS_MASTER | ||
| 18 | "[" SCM_BRANCH_STR "] " | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #ifdef __INTEL_COMPILER | ||
| 22 | BUILD_TYPE_STR SCM_DESC_STR "-ICC"; | ||
| 23 | #else | ||
| 24 | BUILD_TYPE_STR SCM_DESC_STR; | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #ifdef _M_X64 | ||
| 28 | #define NP_ARCH "x64" | ||
| 29 | #else | ||
| 30 | #ifdef _M_ARM | ||
| 31 | #define NP_ARCH "ARM" | ||
| 32 | #else | ||
| 33 | #define NP_ARCH "x86" | ||
| 34 | #endif | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifdef _WIN32 | ||
| 38 | const char *g_netplay_citra_ver = SCM_DESC_STR " W" NP_ARCH; | ||
| 39 | #elif __APPLE__ | ||
| 40 | const char *g_netplay_citra_ver = SCM_DESC_STR " M" NP_ARCH; | ||
| 41 | #else | ||
| 42 | const char *g_netplay_citra_ver = SCM_DESC_STR " L" NP_ARCH; | ||
| 43 | #endif | ||
| 44 | |||
| 45 | const char *scm_rev_git_str = SCM_REV_STR; | ||