diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 000000000..a948ed453 --- /dev/null +++ b/core/.gitignore @@ -0,0 +1 @@ +/version.h diff --git a/core/core.mk b/core/core.mk index cad01b997..1337c531a 100755 --- a/core/core.mk +++ b/core/core.mk @@ -5,7 +5,7 @@ #LDFLAGS := -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common RZDCY_SRC_DIR ?= $(call my-dir) -VERSION_SRC := $(RZDCY_SRC_DIR)/version/version.cpp +VERSION_HEADER := $(RZDCY_SRC_DIR)/version.h RZDCY_MODULES := cfg/ hw/arm7/ hw/aica/ hw/holly/ hw/ hw/gdrom/ hw/maple/ hw/modem/ \ hw/mem/ hw/pvr/ hw/sh4/ hw/sh4/interpr/ hw/sh4/modules/ plugins/ profiler/ oslib/ \ @@ -94,7 +94,6 @@ RZDCY_FILES := $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(w RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.cc)) RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.c)) RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S)) -RZDCY_FILES += $(VERSION_SRC) ifdef FOR_PANDORA RZDCY_CFLAGS := \ @@ -156,8 +155,8 @@ endif RZDCY_CXXFLAGS := $(RZDCY_CFLAGS) -fno-exceptions -fno-rtti -std=gnu++11 -$(VERSION_SRC): - echo "const char *version = \"`git describe --tags --always`\";" > $(VERSION_SRC) - echo "const char *git_hash = \"`git rev-parse --short HEAD`\";" >> $(VERSION_SRC) - echo "const char *build_date = \"`date '+%Y-%m-%d %H:%M:%S %Z'`\";" >> $(VERSION_SRC) +$(VERSION_HEADER): + echo "#define REICAST_VERSION \"`git describe --tags --always`\"" > $(VERSION_HEADER) + echo "#define GIT_HASH \"`git rev-parse --short HEAD`\"" >> $(VERSION_HEADER) + echo "#define BUILD_DATE \"`date '+%Y-%m-%d %H:%M:%S %Z'`\"" >> $(VERSION_HEADER) diff --git a/core/rend/gui.cpp b/core/rend/gui.cpp index 4b53795fb..54786facf 100644 --- a/core/rend/gui.cpp +++ b/core/rend/gui.cpp @@ -34,7 +34,7 @@ #include "linux-dist/main.h" // FIXME for kcode[] #include "gui_util.h" #include "gui_android.h" -#include "version/version.h" +#include "version.h" extern void dc_loadstate(); extern void dc_savestate(); @@ -1041,9 +1041,9 @@ static void gui_display_settings() ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, normal_padding); if (ImGui::CollapsingHeader("Reicast", ImGuiTreeNodeFlags_DefaultOpen)) { - ImGui::Text("Version: %s", version); - ImGui::Text("Git Hash: %s", git_hash); - ImGui::Text("Build Date: %s", build_date); + ImGui::Text("Version: %s", REICAST_VERSION); + ImGui::Text("Git Hash: %s", GIT_HASH); + ImGui::Text("Build Date: %s", BUILD_DATE); ImGui::Text("Target: %s", #if DC_PLATFORM == DC_PLATFORM_DREAMCAST "Dreamcast" diff --git a/core/version/.gitignore b/core/version/.gitignore deleted file mode 100644 index 1946cee8c..000000000 --- a/core/version/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/version.cpp diff --git a/core/version/version.h b/core/version/version.h deleted file mode 100644 index 3c9912aa7..000000000 --- a/core/version/version.h +++ /dev/null @@ -1,3 +0,0 @@ -extern const char *version; -extern const char *git_hash; -extern const char *build_date; diff --git a/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj b/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj index b50789eb9..a12ad753f 100644 --- a/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj +++ b/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj @@ -2199,7 +2199,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"const char *version = \\\"`git describe --tags --always`\\\";\" > $SRCROOT/../../../core/version/version.cpp\necho \"const char *git_hash = \\\"`git rev-parse --short HEAD`\\\";\" >> $SRCROOT/../../../core/version/version.cpp\necho \"const char *build_date = \\\"`date '+%Y-%m-%d %H:%M:%S %Z'`\\\";\" >> $SRCROOT/../../../core/version/version.cpp\n"; + shellScript = "echo \"#define REICAST_VERSION \\\"`git describe --tags --always`\\\"\" > $SRCROOT/../../../core/version.h\necho \"#define GIT_HASH \\\"`git rev-parse --short HEAD`\\\"\" >> $SRCROOT/../../../core/version.h\necho \"#define BUILD_DATE \\\"`date '+%Y-%m-%d %H:%M:%S %Z'`\\\"\" >> $SRCROOT/../../../core/version.h\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/shell/linux/Makefile b/shell/linux/Makefile index eea87ef76..aa2acba74 100644 --- a/shell/linux/Makefile +++ b/shell/linux/Makefile @@ -421,6 +421,12 @@ OBJECTS:=$(OBJECTS:.c=.build_obj) OBJECTS:=$(OBJECTS:.S=.build_obj) OBJECTS:=$(patsubst $(RZDCY_SRC_DIR)/%,$(BUILDDIR)/%,$(OBJECTS)) +ifdef FOR_WINDOWS +OBJECTS+=$(BUILDDIR)/reicastres.build_obj +$(BUILDDIR)/reicastres.build_obj: $(LOCAL_PATH)/../windows/reicast.rc $(LOCAL_PATH)/../windows/reicast.ico $(RZDCY_SRC_DIR)/version.h + windres $< $@ +endif + DEPDIR := .dep-$(BUILDDIR) DEPFLAGS = -MT $@ -MD -MP -MF $(DEPDIR)/$*.Td DEPS=$(RZDCY_FILES:.cpp=.d) @@ -500,7 +506,7 @@ uninstall: rm -f $(DESTDIR)$(ICON_DIR)/reicast.png clean: - rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE_STRIPPED) .map + rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE_STRIPPED) .map $(RZDCY_SRC_DIR)/version.h .PRECIOUS = $(DEPDIR)/%.d $(DEPDIR)/%.d: ; diff --git a/shell/windows/reicast.ico b/shell/windows/reicast.ico new file mode 100644 index 000000000..99528ed33 Binary files /dev/null and b/shell/windows/reicast.ico differ diff --git a/shell/windows/reicast.rc b/shell/windows/reicast.rc new file mode 100644 index 000000000..13bedb6cf --- /dev/null +++ b/shell/windows/reicast.rc @@ -0,0 +1,39 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" +#include "../../core/version.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "reicast.ico" + +///////////////////////////////////////////////////////////////////////////// + +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Reicast Team" + VALUE "FileDescription", "Reicast" + VALUE "FileVersion", REICAST_VERSION + VALUE "InternalName", "reicast" + VALUE "LegalCopyright", "Copyright (c) Reicast Team. All rights reserved." + VALUE "OriginalFilename", "reicast.exe" + VALUE "ProductName", "Reicast" + VALUE "ProductVersion", REICAST_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END \ No newline at end of file diff --git a/shell/windows/resource.h b/shell/windows/resource.h new file mode 100644 index 000000000..ad4c5aebf --- /dev/null +++ b/shell/windows/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by reicast.rc +// +#define IDI_ICON1 105 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 106 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif