mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
build: VERSION fixes
- rename to VERSION to VGMSTREAM_VERSION to avoid some clashes - improve git-less builds
This commit is contained in:
parent
75bb39b843
commit
52f04eef82
@ -97,7 +97,7 @@ if(WIN32)
|
|||||||
file(TO_NATIVE_PATH "${VGM_BINARY_DIR}/version.h" VERSION_H_PATH)
|
file(TO_NATIVE_PATH "${VGM_BINARY_DIR}/version.h" VERSION_H_PATH)
|
||||||
add_custom_command(OUTPUT ${VGM_BINARY_DIR}/version.h
|
add_custom_command(OUTPUT ${VGM_BINARY_DIR}/version.h
|
||||||
COMMAND "${VGM_SOURCE_DIR}/version.bat"
|
COMMAND "${VGM_SOURCE_DIR}/version.bat"
|
||||||
ARGS ${VERSION_H_PATH} VERSION
|
ARGS ${VERSION_H_PATH}
|
||||||
DEPENDS ${VGM_SOURCE_DIR}/version.bat)
|
DEPENDS ${VGM_SOURCE_DIR}/version.bat)
|
||||||
add_custom_target(version_h DEPENDS ${VGM_BINARY_DIR}/version.h)
|
add_custom_target(version_h DEPENDS ${VGM_BINARY_DIR}/version.h)
|
||||||
else()
|
else()
|
||||||
|
33
Makefile
33
Makefile
@ -2,6 +2,19 @@
|
|||||||
# vgmstream makefile
|
# vgmstream makefile
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
|
ifeq ($(VGMSTREAM_VERSION),)
|
||||||
|
# for current dir (expanded later)
|
||||||
|
VGMSTREAM_VERSION_CURR=`./version.sh`
|
||||||
|
# for subdirs (expanded later)
|
||||||
|
VGMSTREAM_VERSION_PREV=`../version.sh`
|
||||||
|
else
|
||||||
|
VGMSTREAM_VERSION_CURR=$(VGMSTREAM_VERSION)
|
||||||
|
VGMSTREAM_VERSION_PREV=$(VGMSTREAM_VERSION)
|
||||||
|
endif
|
||||||
|
|
||||||
|
export VGMSTREAM_VERSION_PREV
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### external defs
|
### external defs
|
||||||
# currently aimed to WIN32 builds but vgmstream_cli should work for others (or use autotools instead)
|
# currently aimed to WIN32 builds but vgmstream_cli should work for others (or use autotools instead)
|
||||||
@ -50,7 +63,7 @@ export RMF SHELL CC AR STRIP WINDRES DLLTOOL
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
### build defs
|
### build defs
|
||||||
|
|
||||||
DEF_CFLAGS = -ffast-math -O3 -Wall -Werror=format-security -Wlogical-op -Wdeclaration-after-statement -Wvla -Wimplicit-function-declaration -Wignored-qualifiers
|
DEF_CFLAGS += -ffast-math -O3 -Wall -Werror=format-security -Wlogical-op -Wdeclaration-after-statement -Wvla -Wimplicit-function-declaration -Wignored-qualifiers
|
||||||
|
|
||||||
VGM_DEBUG_FLAGS = 0
|
VGM_DEBUG_FLAGS = 0
|
||||||
ifeq ($(VGM_DEBUG_FLAGS),1)
|
ifeq ($(VGM_DEBUG_FLAGS),1)
|
||||||
@ -167,20 +180,20 @@ buildrelease-ex: clean bin-ex
|
|||||||
buildfullrelease: clean sourceball bin
|
buildfullrelease: clean sourceball bin
|
||||||
|
|
||||||
sourceball:
|
sourceball:
|
||||||
rm -rf vgmstream-`./version.sh`
|
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||||
git checkout-index -f -a --prefix=vgmstream-`./version.sh`/
|
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION_CURR)/
|
||||||
# git archive --format zip --output vgmstream-`./version.sh`.zip master
|
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION_CURR).zip master
|
||||||
echo "#!/bin/sh" > vgmstream-`./version.sh`/version.sh
|
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION_CURR)/version.sh
|
||||||
echo "echo \"`./version.sh`\"" >> vgmstream-`./version.sh`/version.sh
|
echo "echo \"$(VGMSTREAM_VERSION_CURR)\"" >> vgmstream-$(VGMSTREAM_VERSION_CURR)/version.sh
|
||||||
tar cvzf "vgmstream-`./version.sh`.tar.gz" vgmstream-`./version.sh`/*
|
tar cvzf "vgmstream-$(VGMSTREAM_VERSION_CURR).tar.gz" vgmstream-$(VGMSTREAM_VERSION_CURR)/*
|
||||||
rm -rf vgmstream-`./version.sh`
|
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||||
|
|
||||||
bin mingwbin: vgmstream_cli winamp xmplay
|
bin mingwbin: vgmstream_cli winamp xmplay
|
||||||
zip -FS -j "vgmstream-`./version.sh`-test.zip" $(ZIP_FILES)
|
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES)
|
||||||
|
|
||||||
#separate since vgmstream123 is kinda untested
|
#separate since vgmstream123 is kinda untested
|
||||||
bin-ex mingwbin-ex: vgmstream_cli winamp xmplay vgmstream123
|
bin-ex mingwbin-ex: vgmstream_cli winamp xmplay vgmstream123
|
||||||
zip -FS -j "vgmstream-`./version.sh`-test.zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
||||||
|
|
||||||
vgmstream_cli mingw_test:
|
vgmstream_cli mingw_test:
|
||||||
$(MAKE) -C cli vgmstream_cli
|
$(MAKE) -C cli vgmstream_cli
|
||||||
|
@ -40,7 +40,7 @@ extract_non_defines(GTK_CFLAGS_OTHER GTK_CFLAGS_OTHER)
|
|||||||
target_compile_definitions(audacious_vgmstream PRIVATE
|
target_compile_definitions(audacious_vgmstream PRIVATE
|
||||||
${AUDACIOUS_DEFINES}
|
${AUDACIOUS_DEFINES}
|
||||||
${GTK_DEFINES}
|
${GTK_DEFINES}
|
||||||
VERSION="${VGMSTREAM_VERSION}")
|
VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
|
|
||||||
# Include compile flags for Audacious and GTK
|
# Include compile flags for Audacious and GTK
|
||||||
set_target_properties(audacious_vgmstream PROPERTIES
|
set_target_properties(audacious_vgmstream PROPERTIES
|
||||||
|
@ -6,7 +6,7 @@ inputplugindir = $(plugindir)/$(INPUT_PLUGIN_DIR)
|
|||||||
inputplugin_LTLIBRARIES = libvgmstream.la
|
inputplugin_LTLIBRARIES = libvgmstream.la
|
||||||
|
|
||||||
AM_MAKEFLAGS=-f Makefile.autotools
|
AM_MAKEFLAGS=-f Makefile.autotools
|
||||||
AM_CXXFLAGS = -DVERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
AM_CXXFLAGS = -DVGMSTREAM_VERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
||||||
AM_LIBS =
|
AM_LIBS =
|
||||||
|
|
||||||
# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though)
|
# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though)
|
||||||
|
@ -22,11 +22,11 @@ extern "C" {
|
|||||||
#include "vfs.h"
|
#include "vfs.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#include "version.h"
|
#include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#define VERSION "(unknown version)"
|
#define VGMSTREAM_VERSION "(unknown-version)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CFG_ID "vgmstream" // ID for storing in audacious
|
#define CFG_ID "vgmstream" // ID for storing in audacious
|
||||||
@ -64,7 +64,7 @@ const char *const VgmstreamPlugin::defaults[] = {
|
|||||||
|
|
||||||
// N_(...) for i18n but not much point here
|
// N_(...) for i18n but not much point here
|
||||||
const char VgmstreamPlugin::about[] =
|
const char VgmstreamPlugin::about[] =
|
||||||
"vgmstream plugin " VERSION " " __DATE__ "\n"
|
"vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n"
|
||||||
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
|
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Audacious plugin:\n"
|
"Audacious plugin:\n"
|
||||||
|
@ -31,7 +31,7 @@ if(WIN32)
|
|||||||
add_dependencies(vgmstream_cli version_h)
|
add_dependencies(vgmstream_cli version_h)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
if(VGMSTREAM_VERSION)
|
if(VGMSTREAM_VERSION)
|
||||||
target_compile_definitions(vgmstream_cli PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(vgmstream_cli PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the EXE
|
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the EXE
|
||||||
@ -45,7 +45,7 @@ if(WIN32)
|
|||||||
install_dlls(${CMAKE_INSTALL_PREFIX}/bin)
|
install_dlls(${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
elseif(VGMSTREAM_VERSION)
|
elseif(VGMSTREAM_VERSION)
|
||||||
# Include the version string
|
# Include the version string
|
||||||
target_compile_definitions(vgmstream_cli PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(vgmstream_cli PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ if(NOT WIN32)
|
|||||||
${AO_INCLUDE_DIR})
|
${AO_INCLUDE_DIR})
|
||||||
|
|
||||||
# Include the version string
|
# Include the version string
|
||||||
target_compile_definitions(vgmstream123 PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(vgmstream123 PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@ export CFLAGS LDFLAGS
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
$(CC) $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
||||||
$(STRIP) $(OUTPUT_CLI)
|
$(STRIP) $(OUTPUT_CLI)
|
||||||
|
|
||||||
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) $(CFLAGS) -I$(LIBAO_INC_PATH) "-DVERSION=\"`../version.sh`\"" vgmstream123.c $(LDFLAGS) -L$(LIBAO_LIB_PATH) -lao -o $(OUTPUT_123)
|
$(CC) $(CFLAGS) -I$(LIBAO_INC_PATH) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream123.c $(LDFLAGS) -L$(LIBAO_LIB_PATH) -lao -o $(OUTPUT_123)
|
||||||
$(STRIP) $(OUTPUT_123)
|
$(STRIP) $(OUTPUT_123)
|
||||||
|
|
||||||
libvgmstream.a:
|
libvgmstream.a:
|
||||||
|
@ -39,11 +39,11 @@
|
|||||||
#include "../src/vgmstream.h"
|
#include "../src/vgmstream.h"
|
||||||
#include "../src/plugins.h"
|
#include "../src/plugins.h"
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
# include "version.h"
|
# include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
# define VERSION "(unknown version)"
|
# define VGMSTREAM_VERSION "(unknown version)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ static void usage(const char *progname) {
|
|||||||
default_driver = info->short_name;
|
default_driver = info->short_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("vgmstream123 " VERSION ", built " __DATE__ "\n"
|
printf("vgmstream123 " VGMSTREAM_VERSION ", built " __DATE__ "\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Usage: %s [options] INFILE ...\n"
|
"Usage: %s [options] INFILE ...\n"
|
||||||
"Play streamed audio from video games.\n"
|
"Play streamed audio from video games.\n"
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
#define STDOUT_FILENO 1
|
#define STDOUT_FILENO 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#include "version.h"
|
#include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#define VERSION "(unknown version)"
|
#define VGMSTREAM_VERSION "(unknown version)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_JSON
|
#ifdef HAVE_JSON
|
||||||
@ -39,7 +39,7 @@
|
|||||||
static size_t make_wav_header(uint8_t* buf, size_t buf_size, int32_t sample_count, int32_t sample_rate, int channels, int smpl_chunk, int32_t loop_start, int32_t loop_end);
|
static size_t make_wav_header(uint8_t* buf, size_t buf_size, int32_t sample_count, int32_t sample_rate, int channels, int smpl_chunk, int32_t loop_start, int32_t loop_end);
|
||||||
|
|
||||||
static void usage(const char* name, int is_full) {
|
static void usage(const char* name, int is_full) {
|
||||||
fprintf(stderr,"vgmstream CLI decoder " VERSION " " __DATE__ "\n"
|
fprintf(stderr,"vgmstream CLI decoder " VGMSTREAM_VERSION " " __DATE__ "\n"
|
||||||
"Usage: %s [-o <outfile.wav>] [options] <infile>\n"
|
"Usage: %s [-o <outfile.wav>] [options] <infile>\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -o <outfile.wav>: name of output .wav file, default <infile>.wav\n"
|
" -o <outfile.wav>: name of output .wav file, default <infile>.wav\n"
|
||||||
@ -457,7 +457,7 @@ void print_json_version() {
|
|||||||
json_array_append(cext_list, cext);
|
json_array_append(cext_list, cext);
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t* version_string = json_string(VERSION);
|
json_t* version_string = json_string(VGMSTREAM_VERSION);
|
||||||
|
|
||||||
json_t* final_object = json_object();
|
json_t* final_object = json_object();
|
||||||
json_object_set(final_object, "version", version_string);
|
json_object_set(final_object, "version", version_string);
|
||||||
@ -913,7 +913,7 @@ fail:
|
|||||||
|
|
||||||
#ifdef HAVE_JSON
|
#ifdef HAVE_JSON
|
||||||
static void print_json_info(VGMSTREAM* vgm, cli_config* cfg) {
|
static void print_json_info(VGMSTREAM* vgm, cli_config* cfg) {
|
||||||
json_t* version_string = json_string(VERSION);
|
json_t* version_string = json_string(VGMSTREAM_VERSION);
|
||||||
vgmstream_info info;
|
vgmstream_info info;
|
||||||
describe_vgmstream_info(vgm, &info);
|
describe_vgmstream_info(vgm, &info);
|
||||||
|
|
||||||
|
@ -88,10 +88,10 @@
|
|||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -116,10 +116,10 @@
|
|||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -63,7 +63,7 @@ if(MSVC)
|
|||||||
add_dependencies(foo_input_vgmstream version_h)
|
add_dependencies(foo_input_vgmstream version_h)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
if(VGMSTREAM_VERSION)
|
if(VGMSTREAM_VERSION)
|
||||||
target_compile_definitions(foo_input_vgmstream PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(foo_input_vgmstream PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
||||||
|
@ -88,10 +88,10 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -118,10 +118,10 @@
|
|||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -19,18 +19,17 @@ extern "C" {
|
|||||||
#include "foo_vgmstream.h"
|
#include "foo_vgmstream.h"
|
||||||
#include "foo_filetypes.h"
|
#include "foo_filetypes.h"
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#include "version.h"
|
#include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef VGMSTREAM_VERSION
|
||||||
#ifndef VERSION
|
|
||||||
#define PLUGIN_VERSION __DATE__
|
#define PLUGIN_VERSION __DATE__
|
||||||
#else
|
#else
|
||||||
#define PLUGIN_VERSION VERSION
|
#define PLUGIN_VERSION VGMSTREAM_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define APP_NAME "vgmstream plugin"
|
#define APP_NAME "vgmstream plugin"
|
||||||
#define PLUGIN_DESCRIPTION "vgmstream plugin " VERSION " " __DATE__ "\n" \
|
#define PLUGIN_DESCRIPTION "vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n" \
|
||||||
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n" \
|
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
"foobar2000 plugin by Josh W, kode54\n" \
|
"foobar2000 plugin by Josh W, kode54\n" \
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
REM creates or updates version.h
|
REM creates or updates version.h
|
||||||
REM params: $1=filename (usually version.h), $2=VARNAME (usually VERSION)
|
REM params (optional): $1=filename (usually [relpath]/version.h), $2=VARNAME (usually VGMSTREAM_VERSION)
|
||||||
|
|
||||||
setlocal enableextensions enabledelayedexpansion
|
setlocal enableextensions enabledelayedexpansion
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ set VERSION_DEFAULT=unknown
|
|||||||
set VERSION_FILE=%1
|
set VERSION_FILE=%1
|
||||||
set VERSION_NAME=%2
|
set VERSION_NAME=%2
|
||||||
if "%~1" == "" set VERSION_FILE=version.h
|
if "%~1" == "" set VERSION_FILE=version.h
|
||||||
if "%~2" == "" set VERSION_NAME=VERSION
|
if "%~2" == "" set VERSION_NAME=VGMSTREAM_VERSION
|
||||||
|
|
||||||
if not "%version%"=="" set version=!version:^:=_!
|
if not "%version%"=="" set version=!version:^:=_!
|
||||||
|
|
||||||
|
4
version.h
Normal file
4
version.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* Static/fallback version.
|
||||||
|
* Version is autogenerated from Git (passed via compiler args, or updated with scripts), but this file is
|
||||||
|
* for Git-less builds (not installed or downloaded master) and builds that don't do the above should still work. */
|
||||||
|
#define VGMSTREAM_VERSION "unknown"
|
@ -12,7 +12,7 @@ fi
|
|||||||
|
|
||||||
# ignore git stderr "fatal:
|
# ignore git stderr "fatal:
|
||||||
if case $VERSION in fatal*) ;; *) false;; esac; then
|
if case $VERSION in fatal*) ;; *) false;; esac; then
|
||||||
echo ""
|
echo "unknown"
|
||||||
else
|
else
|
||||||
echo "$VERSION"
|
echo "$VERSION"
|
||||||
fi;
|
fi;
|
||||||
|
@ -38,7 +38,7 @@ if(MSVC)
|
|||||||
add_dependencies(in_vgmstream version_h)
|
add_dependencies(in_vgmstream version_h)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
if(VGMSTREAM_VERSION)
|
if(VGMSTREAM_VERSION)
|
||||||
target_compile_definitions(in_vgmstream PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(in_vgmstream PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
||||||
|
@ -38,7 +38,7 @@ SRC_SRCS = in_vgmstream.c in_streamfile.c in_config.c
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
||||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
||||||
$(STRIP) $(OUTPUT_WINAMP)
|
$(STRIP) $(OUTPUT_WINAMP)
|
||||||
|
|
||||||
resource.o: resource.rc resource.h
|
resource.o: resource.rc resource.h
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
*/
|
*/
|
||||||
#include "in_vgmstream.h"
|
#include "in_vgmstream.h"
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#include "version.h"
|
#include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#define VERSION "(unknown version)"
|
#define VGMSTREAM_VERSION "(unknown version)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PLUGIN_DESCRIPTION "vgmstream plugin " VERSION " " __DATE__
|
#define PLUGIN_DESCRIPTION "vgmstream plugin " VGMSTREAM_VERSION " " __DATE__
|
||||||
|
|
||||||
|
|
||||||
/* ***************************************** */
|
/* ***************************************** */
|
||||||
|
@ -89,10 +89,10 @@
|
|||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -119,10 +119,10 @@
|
|||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -22,7 +22,7 @@ if(MSVC)
|
|||||||
add_dependencies(xmp-vgmstream version_h)
|
add_dependencies(xmp-vgmstream version_h)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
if(VGMSTREAM_VERSION)
|
if(VGMSTREAM_VERSION)
|
||||||
target_compile_definitions(xmp-vgmstream PRIVATE VERSION="${VGMSTREAM_VERSION}")
|
target_compile_definitions(xmp-vgmstream PRIVATE VGMSTREAM_VERSION="${VGMSTREAM_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
|
||||||
|
@ -36,7 +36,7 @@ export CFLAGS LDFLAGS
|
|||||||
### targets
|
### targets
|
||||||
|
|
||||||
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
|
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
||||||
$(STRIP) $(OUTPUT_XMPLAY)
|
$(STRIP) $(OUTPUT_XMPLAY)
|
||||||
|
|
||||||
libvgmstream.a:
|
libvgmstream.a:
|
||||||
|
@ -77,10 +77,10 @@
|
|||||||
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -107,10 +107,10 @@
|
|||||||
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>"$(ProjectDir)..\version.bat" "$(ProjectDir)..\version.h" VERSION</Command>
|
<Command>"$(ProjectDir)..\version.bat"</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Generating version.h</Message>
|
<Message>Generating version</Message>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
#include "../src/plugins.h"
|
#include "../src/plugins.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#include "version.h"
|
#include "../version.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef VERSION
|
#ifndef VGMSTREAM_VERSION
|
||||||
#define VERSION "(unknown version)"
|
#define VGMSTREAM_VERSION "(unknown version)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ************************************* */
|
/* ************************************* */
|
||||||
@ -435,7 +435,7 @@ static void build_extension_list() {
|
|||||||
/* info for the "about" button in plugin options */
|
/* info for the "about" button in plugin options */
|
||||||
void WINAPI xmplay_About(HWND win) {
|
void WINAPI xmplay_About(HWND win) {
|
||||||
MessageBox(win,
|
MessageBox(win,
|
||||||
"vgmstream plugin " VERSION " " __DATE__ "\n"
|
"vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n"
|
||||||
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
|
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
|
||||||
"\n"
|
"\n"
|
||||||
"XMPlay plugin by unknownfile, PSXGamerPro1, kode54\n"
|
"XMPlay plugin by unknownfile, PSXGamerPro1, kode54\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user