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 1d6c1b0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
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
5 changes: 3 additions & 2 deletions 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 All @@ -21,7 +22,7 @@ int dol_argc = 0;
char *dol_argv[MAX_NUM_ARGV];
u16 all_buttons_held;

char *default_path = "/ipl.dol";
char *default_path = "/ipl2.dol";
struct shortcut {
u16 pad_buttons;
char *path;
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 1d6c1b0

Please sign in to comment.