Skip to content

Commit

Permalink
Update plugin name to include git commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
saneki committed Jun 6, 2022
1 parent 04bebce commit 10e38bc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/git.h
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "src/parallel-rdp"]
path = src/parallel-rdp
url = https://github.com/Themaister/parallel-rdp-standalone.git
[submodule "cmake-git-version-tracking"]
path = cmake-git-version-tracking
url = https://github.com/andrew-hardin/cmake-git-version-tracking
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ set(CMAKE_C_STANDARD 99)

project(pj64-parallel-rdp LANGUAGES C CXX)

# Generate git info into header file.
set(PRE_CONFIGURE_FILE "src/git.h.in")
set(POST_CONFIGURE_FILE "src/git.h")
include(cmake-git-version-tracking/git_watcher.cmake)

add_subdirectory(src)
1 change: 1 addition & 0 deletions cmake-git-version-tracking
8 changes: 7 additions & 1 deletion src/gfx_1.3.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "config_gui.h"
#include "config.h"

#include "git.h"

static bool warn_hle = false;

GFX_INFO gfx;
Expand Down Expand Up @@ -91,9 +93,13 @@ EXPORT void CALL CaptureScreen(char* directory)

EXPORT void CALL GetDllInfo(PLUGIN_INFO* PluginInfo)
{
// Copy substring of git hash into buffer.
char hash[8] = {0};
strncpy(hash, GIT_HEAD_SHA1, 7);

PluginInfo->Version = 0x0103;
PluginInfo->Type = PLUGIN_TYPE_GFX;
sprintf(PluginInfo->Name, "ParaLLEl");
snprintf(PluginInfo->Name, sizeof(PluginInfo->Name), "ParaLLEl-RDP rev.%s", hash);

PluginInfo->NormalMemory = TRUE;
PluginInfo->MemoryBswaped = TRUE;
Expand Down
3 changes: 3 additions & 0 deletions src/git.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

#define GIT_HEAD_SHA1 "@GIT_HEAD_SHA1@"

0 comments on commit 10e38bc

Please sign in to comment.