Log the module version on each application start

This commit is contained in:
Maschell 2022-10-09 14:21:46 +02:00
parent d3629321e1
commit 4da0dd9e3f
4 changed files with 24 additions and 1 deletions

View File

@ -18,6 +18,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./source/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -26,6 +26,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./source/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -1,5 +1,6 @@
#include "function_replacements.h" #include "function_replacements.h"
#include "memory_mapping.h" #include "memory_mapping.h"
#include "version.h"
#include <coreinit/debug.h> #include <coreinit/debug.h>
#include <function_patcher/function_patching.h> #include <function_patcher/function_patching.h>
#include <wums.h> #include <wums.h>
@ -7,6 +8,8 @@
#include "logger.h" #include "logger.h"
#endif #endif
#define VERSION "v0.1"
WUMS_MODULE_EXPORT_NAME("homebrew_memorymapping"); WUMS_MODULE_EXPORT_NAME("homebrew_memorymapping");
WUMS_MODULE_SKIP_INIT_FINI(); WUMS_MODULE_SKIP_INIT_FINI();
WUMS_MODULE_INIT_BEFORE_RELOCATION_DONE_HOOK(); WUMS_MODULE_INIT_BEFORE_RELOCATION_DONE_HOOK();
@ -28,11 +31,15 @@ WUMS_INITIALIZE(args) {
} }
} }
#ifdef DEBUG
WUMS_APPLICATION_STARTS() { WUMS_APPLICATION_STARTS() {
OSReport("Running MemoryMappingModule " VERSION VERSION_EXTRA "\n");
#ifdef DEBUG
initLogging(); initLogging();
#endif
} }
#ifdef DEBUG
WUMS_APPLICATION_REQUESTS_EXIT() { WUMS_APPLICATION_REQUESTS_EXIT() {
deinitLogging(); deinitLogging();
} }

2
source/version.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define VERSION_EXTRA ""