Skip to content

Commit

Permalink
Add version string
Browse files Browse the repository at this point in the history
  • Loading branch information
9ary committed Dec 5, 2023
1 parent 0a5b2d7 commit 8399f8e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ subdir('stub')

linker_script = meson.current_source_dir() / 'ogc.ld'

git = find_program('git')
version_file = vcs_tag(
command: [git, 'describe', '--always', '--tags', '--dirty'],
input: 'source/version.c.in',
output: 'version.c',
)

iplboot = executable(
'iplboot',
'source/main.c',
Expand All @@ -42,6 +49,7 @@ iplboot = executable(
'source/fatfs/ffsystem.c',
'source/fatfs/ffunicode.c',
'source/ffshim.c',
version_file,
dependencies: [
libogc_deps['ogc'],
stub_dep,
Expand Down
3 changes: 2 additions & 1 deletion source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ffshim.h"
#include "fatfs/ff.h"
#include "utils.h"
#include "version.h"

#include "stub.h"

Expand Down Expand Up @@ -346,7 +347,7 @@ int main()
VIDEO_WaitVSync();
CON_Init(__xfb, 0, 0, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ);

kprintf("\n\niplboot\n");
kprintf("\n\niplboot %s\n", version);

// Disable Qoob
u32 val = 6 << 24;
Expand Down
1 change: 1 addition & 0 deletions source/version.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
char version[] = "@VCS_TAG@";
3 changes: 3 additions & 0 deletions source/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

extern char version[];

0 comments on commit 8399f8e

Please sign in to comment.