mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
build: Generate xemu version header
This commit is contained in:
parent
e0f4ea28ca
commit
6e2d5a993f
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,5 +16,4 @@ GTAGS
|
|||||||
build.log
|
build.log
|
||||||
|
|
||||||
/dist
|
/dist
|
||||||
/xemu-version.c
|
|
||||||
/xemu.ini
|
/xemu.ini
|
||||||
|
35
meson.build
35
meson.build
@ -149,6 +149,20 @@ if sparse.found()
|
|||||||
'-Wno-non-pointer-null'])
|
'-Wno-non-pointer-null'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# xemu Version
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
xemu_version_cmd = [find_program('scripts/xemu-version.sh'),
|
||||||
|
meson.current_source_dir()]
|
||||||
|
xemu_version = custom_target('xemu-version-macro.h',
|
||||||
|
output: 'xemu-version-macro.h',
|
||||||
|
command: xemu_version_cmd,
|
||||||
|
capture: true,
|
||||||
|
build_by_default: true,
|
||||||
|
build_always_stale: true)
|
||||||
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Target-specific checks and dependencies #
|
# Target-specific checks and dependencies #
|
||||||
###########################################
|
###########################################
|
||||||
@ -178,7 +192,8 @@ if targetos == 'windows'
|
|||||||
win = import('windows')
|
win = import('windows')
|
||||||
version_res = win.compile_resources('version.rc',
|
version_res = win.compile_resources('version.rc',
|
||||||
depend_files: files('pc-bios/qemu-nsis.ico'),
|
depend_files: files('pc-bios/qemu-nsis.ico'),
|
||||||
include_directories: include_directories('.'))
|
include_directories: include_directories('.'),
|
||||||
|
depends: xemu_version)
|
||||||
elif targetos == 'darwin'
|
elif targetos == 'darwin'
|
||||||
coref = dependency('appleframeworks', modules: 'CoreFoundation')
|
coref = dependency('appleframeworks', modules: 'CoreFoundation')
|
||||||
iokit = dependency('appleframeworks', modules: 'IOKit')
|
iokit = dependency('appleframeworks', modules: 'IOKit')
|
||||||
@ -1712,16 +1727,8 @@ qemu_version = custom_target('qemu-version.h',
|
|||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
build_always_stale: true)
|
build_always_stale: true)
|
||||||
|
|
||||||
xemu_version_cmd = [find_program('scripts/xemu-version.sh'),
|
|
||||||
meson.current_source_dir()]
|
|
||||||
xemu_version = custom_target('xemu-version.c',
|
|
||||||
output: 'xemu-version.c',
|
|
||||||
command: xemu_version_cmd,
|
|
||||||
capture: true,
|
|
||||||
build_by_default: true,
|
|
||||||
build_always_stale: true)
|
|
||||||
|
|
||||||
genh += qemu_version
|
genh += qemu_version
|
||||||
|
genh += xemu_version
|
||||||
|
|
||||||
hxdep = []
|
hxdep = []
|
||||||
hx_headers = [
|
hx_headers = [
|
||||||
@ -1946,13 +1953,7 @@ if have_block
|
|||||||
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
|
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
specific_ss.add(files('xemu-xbe.c'))
|
specific_ss.add(files('xemu-xbe.c', 'xemu-version.c'))
|
||||||
|
|
||||||
libxemuver = static_library('xemuver', sources: xemu_version,
|
|
||||||
name_suffix: 'fa',
|
|
||||||
build_by_default: false)
|
|
||||||
xemuver = declare_dependency(link_whole: libxemuver)
|
|
||||||
common_ss.add(xemuver)
|
|
||||||
|
|
||||||
common_ss.add(files('cpus-common.c'))
|
common_ss.add(files('cpus-common.c'))
|
||||||
|
|
||||||
|
@ -26,9 +26,26 @@ XEMU_VERSION=$( \
|
|||||||
cat XEMU_VERSION; \
|
cat XEMU_VERSION; \
|
||||||
fi)
|
fi)
|
||||||
|
|
||||||
|
get_version_field() {
|
||||||
|
echo ${XEMU_VERSION}-0 | cut -d- -f$1
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version_dot () {
|
||||||
|
echo $(get_version_field 1) | cut -d. -f$1
|
||||||
|
}
|
||||||
|
|
||||||
|
XEMU_VERSION_MAJOR=$(get_version_dot 1)
|
||||||
|
XEMU_VERSION_MINOR=$(get_version_dot 2)
|
||||||
|
XEMU_VERSION_MICRO=$(get_version_dot 3)
|
||||||
|
XEMU_VERSION_PATCH=$(get_version_field 2)
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
const char *xemu_version = "$XEMU_VERSION";
|
#define XEMU_VERSION "$XEMU_VERSION"
|
||||||
const char *xemu_branch = "$XEMU_BRANCH";
|
#define XEMU_VERSION_MAJOR $XEMU_VERSION_MAJOR
|
||||||
const char *xemu_commit = "$XEMU_COMMIT";
|
#define XEMU_VERSION_MINOR $XEMU_VERSION_MINOR
|
||||||
const char *xemu_date = "$XEMU_DATE";
|
#define XEMU_VERSION_MICRO $XEMU_VERSION_MICRO
|
||||||
|
#define XEMU_VERSION_PATCH $XEMU_VERSION_PATCH
|
||||||
|
#define XEMU_BRANCH "$XEMU_BRANCH"
|
||||||
|
#define XEMU_COMMIT "$XEMU_COMMIT"
|
||||||
|
#define XEMU_DATE "$XEMU_DATE"
|
||||||
EOF
|
EOF
|
||||||
|
15
version.rc
15
version.rc
@ -1,17 +1,10 @@
|
|||||||
#include <winver.h>
|
#include <winver.h>
|
||||||
#if 0
|
|
||||||
#include "config-host.h"
|
#include "config-host.h"
|
||||||
#endif
|
#include "xemu-version-macro.h"
|
||||||
|
|
||||||
/* FIXME: Automate */
|
|
||||||
#define QEMU_VERSION "0.5.1"
|
|
||||||
#define QEMU_VERSION_MAJOR 0
|
|
||||||
#define QEMU_VERSION_MINOR 5
|
|
||||||
#define QEMU_VERSION_MICRO 1
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
|
FILEVERSION XEMU_VERSION_MAJOR,XEMU_VERSION_MINOR,XEMU_VERSION_MICRO,XEMU_VERSION_PATCH
|
||||||
PRODUCTVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
|
PRODUCTVERSION XEMU_VERSION_MAJOR,XEMU_VERSION_MINOR,XEMU_VERSION_MICRO,XEMU_VERSION_PATCH
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
FILEOS VOS_NT_WINDOWS32
|
FILEOS VOS_NT_WINDOWS32
|
||||||
FILETYPE VFT_APP
|
FILETYPE VFT_APP
|
||||||
@ -23,7 +16,7 @@ FILESUBTYPE VFT2_UNKNOWN
|
|||||||
{
|
{
|
||||||
VALUE "CompanyName", "https://xemu.app"
|
VALUE "CompanyName", "https://xemu.app"
|
||||||
VALUE "FileDescription", "xemu: Original Xbox Emulator"
|
VALUE "FileDescription", "xemu: Original Xbox Emulator"
|
||||||
VALUE "FileVersion", QEMU_VERSION
|
VALUE "FileVersion", XEMU_VERSION
|
||||||
VALUE "LegalCopyright", "Copyright various authors. Released under the GNU General Public License."
|
VALUE "LegalCopyright", "Copyright various authors. Released under the GNU General Public License."
|
||||||
VALUE "LegalTrademarks", "QEMU is a trademark of Fabrice Bellard."
|
VALUE "LegalTrademarks", "QEMU is a trademark of Fabrice Bellard."
|
||||||
VALUE "ProductName", "xemu"
|
VALUE "ProductName", "xemu"
|
||||||
|
6
xemu-version.c
Normal file
6
xemu-version.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "xemu-version-macro.h"
|
||||||
|
|
||||||
|
const char *xemu_version = XEMU_VERSION;
|
||||||
|
const char *xemu_branch = XEMU_BRANCH;;
|
||||||
|
const char *xemu_commit = XEMU_COMMIT;
|
||||||
|
const char *xemu_date = XEMU_DATE;
|
Loading…
Reference in New Issue
Block a user