From 24c0893cf5ea1f234dee7bcbeaa829e921333049 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 4 May 2016 01:36:25 -0700 Subject: [PATCH] All: Put version.h somewhere better --- CMakeLists.txt | 6 +++--- src/core/config.c | 1 + src/{util => core}/version.c.in | 4 ++-- src/{util => core}/version.h | 2 +- src/debugger/cli-debugger.c | 1 + src/feature/commandline.c | 1 + src/platform/example/client-server/client.c | 3 ++- src/platform/libretro/libretro.c | 1 + src/platform/qt/AboutScreen.cpp | 2 +- src/platform/qt/GBAApp.cpp | 1 + src/platform/qt/ShaderSelector.cpp | 1 + src/platform/qt/Window.cpp | 1 + src/platform/sdl/gl-common.c | 2 ++ src/util/common.h | 2 -- 14 files changed, 18 insertions(+), 10 deletions(-) rename src/{util => core}/version.c.in (89%) rename src/{util => core}/version.h (92%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e79ce1281..5d096767b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,16 +106,16 @@ function(find_feature FEATURE_NAME FEATURE_REQUIRES) endfunction() # Version information -add_custom_target(version-info ALL ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/src/util/version.c.in +add_custom_target(version-info ALL ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in COMMAND ${CMAKE_COMMAND} -DBINARY_NAME=${BINARY_NAME} - -DCONFIG_FILE=${CMAKE_CURRENT_SOURCE_DIR}/src/util/version.c.in + -DCONFIG_FILE=${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/version.c -P ${CMAKE_CURRENT_SOURCE_DIR}/version.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) include(${CMAKE_CURRENT_SOURCE_DIR}/version.cmake) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/util/version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c) list(APPEND UTIL_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c) diff --git a/src/core/config.c b/src/core/config.c index 2eec1db86..07b3a7cb3 100644 --- a/src/core/config.c +++ b/src/core/config.c @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "config.h" +#include "core/version.h" #include "util/formatting.h" #include "util/string.h" #include "util/vfs.h" diff --git a/src/util/version.c.in b/src/core/version.c.in similarity index 89% rename from src/util/version.c.in rename to src/core/version.c.in index 563361b21..98fcd6428 100644 --- a/src/util/version.c.in +++ b/src/core/version.c.in @@ -1,9 +1,9 @@ -/* Copyright (c) 2013-2015 Jeffrey Pfau +/* Copyright (c) 2013-2016 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "util/version.h" +#include "core/version.h" const char* const gitCommit = "${GIT_COMMIT}"; const char* const gitCommitShort = "${GIT_COMMIT_SHORT}"; diff --git a/src/util/version.h b/src/core/version.h similarity index 92% rename from src/util/version.h rename to src/core/version.h index 610a7b610..048e47a27 100644 --- a/src/util/version.h +++ b/src/core/version.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015 Jeffrey Pfau +/* Copyright (c) 2013-2016 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/debugger/cli-debugger.c b/src/debugger/cli-debugger.c index 74f7e4fcc..b94c45a8a 100644 --- a/src/debugger/cli-debugger.c +++ b/src/debugger/cli-debugger.c @@ -8,6 +8,7 @@ #ifdef USE_CLI_DEBUGGER #include "core/core.h" +#include "core/version.h" #include "parser.h" #include diff --git a/src/feature/commandline.c b/src/feature/commandline.c index 30eb9a768..9c66d16da 100644 --- a/src/feature/commandline.c +++ b/src/feature/commandline.c @@ -6,6 +6,7 @@ #include "commandline.h" #include "core/config.h" +#include "core/version.h" #include "util/string.h" #include diff --git a/src/platform/example/client-server/client.c b/src/platform/example/client-server/client.c index a470e6a75..c80e54df0 100644 --- a/src/platform/example/client-server/client.c +++ b/src/platform/example/client-server/client.c @@ -3,7 +3,8 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - #include "core/core.h" +#include "core/core.h" +#include "core/version.h" #include "util/socket.h" #include diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c index e74d28e15..6b07a698d 100644 --- a/src/platform/libretro/libretro.c +++ b/src/platform/libretro/libretro.c @@ -8,6 +8,7 @@ #include "util/common.h" #include "core/core.h" +#include "core/version.h" #ifdef M_CORE_GB #include "gb/core.h" #include "gb/gb.h" diff --git a/src/platform/qt/AboutScreen.cpp b/src/platform/qt/AboutScreen.cpp index 5299b88f7..99c5aa2fd 100644 --- a/src/platform/qt/AboutScreen.cpp +++ b/src/platform/qt/AboutScreen.cpp @@ -6,7 +6,7 @@ #include "AboutScreen.h" extern "C" { -#include "util/version.h" +#include "core/version.h" } #include diff --git a/src/platform/qt/GBAApp.cpp b/src/platform/qt/GBAApp.cpp index 153ca9aa7..8e55d12ad 100644 --- a/src/platform/qt/GBAApp.cpp +++ b/src/platform/qt/GBAApp.cpp @@ -16,6 +16,7 @@ #include extern "C" { +#include "core/version.h" #include "feature/commandline.h" #include "util/nointro.h" #include "util/socket.h" diff --git a/src/platform/qt/ShaderSelector.cpp b/src/platform/qt/ShaderSelector.cpp index 577e0a9fb..3f60aeb61 100644 --- a/src/platform/qt/ShaderSelector.cpp +++ b/src/platform/qt/ShaderSelector.cpp @@ -18,6 +18,7 @@ #include extern "C" { +#include "core/version.h" #include "platform/video-backend.h" #if !defined(_WIN32) || defined(USE_EPOXY) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 019ebaab8..e38241da6 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -38,6 +38,7 @@ #include "VideoView.h" extern "C" { +#include "core/version.h" #ifdef M_CORE_GB #include "gb/gb.h" #endif diff --git a/src/platform/sdl/gl-common.c b/src/platform/sdl/gl-common.c index 12aa18000..3e4f7add2 100644 --- a/src/platform/sdl/gl-common.c +++ b/src/platform/sdl/gl-common.c @@ -5,6 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "main.h" +#include "core/version.h" + void mSDLGLCommonSwap(struct VideoBackend* context) { struct mSDLRenderer* renderer = (struct mSDLRenderer*) context->user; #if SDL_VERSION_ATLEAST(2, 0, 0) diff --git a/src/util/common.h b/src/util/common.h index c247d6724..7dd617e5c 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -21,8 +21,6 @@ #include #include -#include "version.h" - #ifdef _WIN32 // WinSock2 gets very angry if it's included too late #include