From 3da3eee15f3fb760fccd491192703ac2ff9a3495 Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Wed, 14 Jan 2015 22:33:27 +0100 Subject: [PATCH 1/9] Fix Git version and Remove old Platform on emucore.vcxproj --- rpcs3/Gui/AboutDialog.h | 6 +- rpcs3/Gui/MainFrame.cpp | 4 +- rpcs3/emucore.vcxproj | 167 ------------------------------------ rpcs3/git-version.h | 6 -- rpcs3/rpcs3.vcxproj | 6 +- rpcs3/rpcs3.vcxproj.filters | 3 + 6 files changed, 12 insertions(+), 180 deletions(-) delete mode 100644 rpcs3/git-version.h diff --git a/rpcs3/Gui/AboutDialog.h b/rpcs3/Gui/AboutDialog.h index bee94e9b1a..8b7620af74 100644 --- a/rpcs3/Gui/AboutDialog.h +++ b/rpcs3/Gui/AboutDialog.h @@ -36,10 +36,10 @@ AboutDialog::AboutDialog(wxWindow *parent) t_descr->SetForegroundColour(wxColor(255,255,255)); t_descr->SetPosition(wxPoint(12,50)); -#ifdef _DEBUG - wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format("Version: " _PRGNAME_ " git-" RPCS3_GIT_VERSION)); +#ifdef WIN32 + wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " "git-" RPCS3_GIT_VERSION)); #else - wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format("Version: " _PRGNAME_ " " _PRGVER_)); + wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " _PRGVER_)); #endif t_version->SetBackgroundColour(wxColor(100,100,100)); t_version->SetForegroundColour(wxColor(200,200,200)); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 45c1a24f68..717f22fd49 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -70,8 +70,8 @@ MainFrame::MainFrame() , m_sys_menu_opened(false) { -#ifdef _DEBUG - SetLabel(wxString::Format(_PRGNAME_ " git-" RPCS3_GIT_VERSION)); +#ifdef WIN32 + SetLabel(wxString::Format(_PRGNAME_ " " RPCS3_GIT_VERSION)); #else SetLabel(wxString::Format(_PRGNAME_ " " _PRGVER_)); #endif diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index b3694d79b4..9f569766f2 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -1,10 +1,6 @@  - - Debug - LLVM - Win32 - Debug - LLVM x64 @@ -17,26 +13,14 @@ Debug - MemLeak x64 - - Debug - Win32 - Debug x64 - - Release - LLVM - Win32 - Release - LLVM x64 - - Release - Win32 - Release x64 @@ -57,14 +41,9 @@ - NotUsing NotUsing - NotUsing - NotUsing NotUsing NotUsing - NotUsing - NotUsing NotUsing NotUsing @@ -253,14 +232,9 @@ true - Create Create - Create - Create Create Create - Create - Create Create Create @@ -477,24 +451,6 @@ emucore - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - true - v120 - Unicode - StaticLibrary true @@ -513,20 +469,6 @@ v120 Unicode - - StaticLibrary - false - v120 - false - Unicode - - - StaticLibrary - false - v120 - false - Unicode - StaticLibrary false @@ -544,15 +486,6 @@ - - - - - - - - - @@ -562,12 +495,6 @@ - - - - - - @@ -575,31 +502,6 @@ - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - .\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - .\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - .\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - .\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - .\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath); - .\;..\;..\minidx9\Include;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include $(Platform)\$(Configuration)\emucore\ @@ -630,43 +532,6 @@ $(LibraryPath) $(ExcludePath) - - - Level3 - Disabled - false - Use - stdafx.h - - - true - - - - - Level3 - Disabled - false - Use - stdafx.h - - - true - - - - - Level3 - Disabled - false - Use - _UNICODE;UNICODE;MSVC_CRT_MEMLEAK_DETECTION;%(PreprocessorDefinitions) - stdafx.h - - - true - - Level3 @@ -720,38 +585,6 @@ true - - - Level3 - MaxSpeed - true - true - false - Use - stdafx.h - - - true - true - true - - - - - Level3 - MaxSpeed - true - true - false - Use - stdafx.h - - - true - true - true - - Level3 diff --git a/rpcs3/git-version.h b/rpcs3/git-version.h deleted file mode 100644 index f770897486..0000000000 --- a/rpcs3/git-version.h +++ /dev/null @@ -1,6 +0,0 @@ -// This is a generated file. - -#define RPCS3_GIT_VERSION "unknown" - -// If you don't want this file to update/recompile, change to 1. -#define RPCS3_GIT_VERSION_NO_UPDATE 1 diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 44c219a587..ade3c6121a 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -94,6 +94,7 @@ "$(SolutionDir)\Utilities\git-version-gen.cmd" + Updating git-version.h false @@ -120,6 +121,7 @@ "$(SolutionDir)\Utilities\git-version-gen.cmd" + Updating git-version.h false @@ -156,8 +158,8 @@ ..\wxWidgets\lib\vc_x64_lib;..\ffmpeg\Windows\x86_64\lib;..\OpenAL\Win64 - - + "$(SolutionDir)\Utilities\git-version-gen.cmd" + Updating git-version.h diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index 71062a8296..e55464ae48 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -194,5 +194,8 @@ Gui + + Gui + \ No newline at end of file From e5b59a6bad392ccf78f87f8c376c6382661267c2 Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Wed, 14 Jan 2015 23:48:55 +0100 Subject: [PATCH 2/9] Fix Compile Linux --- rpcs3/Gui/MainFrame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 717f22fd49..27e097a7f1 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -5,7 +5,6 @@ #include "rpcs3.h" #include "MainFrame.h" -#include "git-version.h" #include "Ini.h" #include "Emu/SysCalls/Modules/cellSysutil.h" #include "Emu/RSX/sysutil_video.h" @@ -22,6 +21,9 @@ #include "Gui/RSXDebugger.h" #include "Gui/MemoryStringSearcher.h" #include "Gui/LLEModulesManager.h" +#ifndef _WIN32 +#include "git-version.h" +#endif #include From 79e8ed47d5bda24515314d95046248660cf28385 Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Thu, 15 Jan 2015 00:46:42 +0100 Subject: [PATCH 3/9] Fix Linux 2 --- rpcs3/Gui/MainFrame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 27e097a7f1..98d2d69bba 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -5,6 +5,9 @@ #include "rpcs3.h" #include "MainFrame.h" +#ifndef __unix__ +#include "git-version.h" +#endif #include "Ini.h" #include "Emu/SysCalls/Modules/cellSysutil.h" #include "Emu/RSX/sysutil_video.h" @@ -21,9 +24,6 @@ #include "Gui/RSXDebugger.h" #include "Gui/MemoryStringSearcher.h" #include "Gui/LLEModulesManager.h" -#ifndef _WIN32 -#include "git-version.h" -#endif #include From d3c9aff2f49715ae18f852ddb275455a870e5ddd Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Thu, 15 Jan 2015 02:26:49 +0100 Subject: [PATCH 4/9] Fix Typho --- rpcs3/Gui/AboutDialog.h | 2 +- rpcs3/Gui/MainFrame.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Gui/AboutDialog.h b/rpcs3/Gui/AboutDialog.h index 8b7620af74..ed6897f2bb 100644 --- a/rpcs3/Gui/AboutDialog.h +++ b/rpcs3/Gui/AboutDialog.h @@ -36,7 +36,7 @@ AboutDialog::AboutDialog(wxWindow *parent) t_descr->SetForegroundColour(wxColor(255,255,255)); t_descr->SetPosition(wxPoint(12,50)); -#ifdef WIN32 +#ifdef _WIN32 wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " "git-" RPCS3_GIT_VERSION)); #else wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " _PRGVER_)); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 98d2d69bba..067d537b34 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -5,7 +5,7 @@ #include "rpcs3.h" #include "MainFrame.h" -#ifndef __unix__ +#ifdef _WIN32 #include "git-version.h" #endif #include "Ini.h" @@ -72,7 +72,7 @@ MainFrame::MainFrame() , m_sys_menu_opened(false) { -#ifdef WIN32 +#ifdef _WIN32 SetLabel(wxString::Format(_PRGNAME_ " " RPCS3_GIT_VERSION)); #else SetLabel(wxString::Format(_PRGNAME_ " " _PRGVER_)); From 71225da13537d7d7a6fe01ac5a680f3577a7b0b7 Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Thu, 15 Jan 2015 02:58:11 +0100 Subject: [PATCH 5/9] don't distinguish between windows and unix for no reason --- rpcs3/CMakeLists.txt | 7 +++++++ rpcs3/Gui/AboutDialog.h | 6 +----- rpcs3/Gui/MainFrame.cpp | 6 ------ rpcs3/git-version.cmake | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 rpcs3/git-version.cmake diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 9245ac9125..c6eb5643db 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -5,6 +5,13 @@ include(cotire) project(rpcs3) +# Generate git-version.cpp at build time. +add_custom_target(GitVersion ALL + DEPENDS something_that_never_exists) +add_custom_command(OUTPUT something_that_never_exists + COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} + -P ${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake) + if (CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0) message(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old.") diff --git a/rpcs3/Gui/AboutDialog.h b/rpcs3/Gui/AboutDialog.h index ed6897f2bb..78584d6d3d 100644 --- a/rpcs3/Gui/AboutDialog.h +++ b/rpcs3/Gui/AboutDialog.h @@ -36,11 +36,7 @@ AboutDialog::AboutDialog(wxWindow *parent) t_descr->SetForegroundColour(wxColor(255,255,255)); t_descr->SetPosition(wxPoint(12,50)); -#ifdef _WIN32 - wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " "git-" RPCS3_GIT_VERSION)); -#else - wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " _PRGVER_)); -#endif + wxStaticText* t_version = new wxStaticText(this, wxID_ANY, wxString::Format(_PRGNAME_" Version : " RPCS3_GIT_VERSION)); t_version->SetBackgroundColour(wxColor(100,100,100)); t_version->SetForegroundColour(wxColor(200,200,200)); t_version->SetPosition(wxPoint(12,66)); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 067d537b34..975af52f18 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -5,9 +5,7 @@ #include "rpcs3.h" #include "MainFrame.h" -#ifdef _WIN32 #include "git-version.h" -#endif #include "Ini.h" #include "Emu/SysCalls/Modules/cellSysutil.h" #include "Emu/RSX/sysutil_video.h" @@ -72,11 +70,7 @@ MainFrame::MainFrame() , m_sys_menu_opened(false) { -#ifdef _WIN32 SetLabel(wxString::Format(_PRGNAME_ " " RPCS3_GIT_VERSION)); -#else - SetLabel(wxString::Format(_PRGNAME_ " " _PRGVER_)); -#endif wxMenuBar* menubar = new wxMenuBar(); diff --git a/rpcs3/git-version.cmake b/rpcs3/git-version.cmake new file mode 100644 index 0000000000..e6b5c86f90 --- /dev/null +++ b/rpcs3/git-version.cmake @@ -0,0 +1,42 @@ +set(GIT_VERSION_FILE "${SOURCE_DIR}/git-version.h") +set(GIT_VERSION "unknown") +set(GIT_VERSION_UPDATE "1") + +find_package(Git) +if(GIT_FOUND) + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always + WORKING_DIRECTORY ${SOURCE_DIR} + RESULT_VARIABLE exit_code + OUTPUT_VARIABLE GIT_VERSION) + if(NOT ${exit_code} EQUAL 0) + message(WARNING "git describe failed, unable to include version.") + endif() + string(STRIP ${GIT_VERSION} GIT_VERSION) +else() + message(WARNING "git not found, unable to include version.") +endif() + +if(EXISTS ${GIT_VERSION_FILE}) + # Don't update if marked not to update. + file(STRINGS ${GIT_VERSION_FILE} match + REGEX "RPCS3_GIT_VERSION_NO_UPDATE 1") + if(NOT ${match} EQUAL "") + set(GIT_VERSION_UPDATE "0") + endif() + + # Don't update if it's already the same. + file(STRINGS ${GIT_VERSION_FILE} match + REGEX "${GIT_VERSION}") + if(NOT ${match} EQUAL "") + set(GIT_VERSION_UPDATE "0") + endif() +endif() + +set(code_string "// This is a generated file.\n\n" + "#define RPCS3_GIT_VERSION \"${GIT_VERSION}\"\;\n\n" + "// If you don't want this file to update/recompile, change to 1.\n" + "#define RPCS3_GIT_VERSION_NO_UPDATE 0\n") + +if ("${GIT_VERSION_UPDATE}" EQUAL "1") + file(WRITE ${GIT_VERSION_FILE} ${code_string}) +endif() \ No newline at end of file From 57361e2943811a4301c24a11d7492a72199fb6e3 Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Thu, 15 Jan 2015 04:00:43 +0100 Subject: [PATCH 6/9] forgot to remove somicolon --- rpcs3/git-version.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/git-version.cmake b/rpcs3/git-version.cmake index e6b5c86f90..82474cd014 100644 --- a/rpcs3/git-version.cmake +++ b/rpcs3/git-version.cmake @@ -33,7 +33,7 @@ if(EXISTS ${GIT_VERSION_FILE}) endif() set(code_string "// This is a generated file.\n\n" - "#define RPCS3_GIT_VERSION \"${GIT_VERSION}\"\;\n\n" + "#define RPCS3_GIT_VERSION \"${GIT_VERSION}\"\n\n" "// If you don't want this file to update/recompile, change to 1.\n" "#define RPCS3_GIT_VERSION_NO_UPDATE 0\n") From 1cf4791f95d95f419a8be81cc1b478444ab0bd00 Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Thu, 15 Jan 2015 04:03:25 +0100 Subject: [PATCH 7/9] Fix correct PATH --- rpcs3/CMakeLists.txt | 2 +- rpcs3/git-version.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index c6eb5643db..c5e6ebe4a0 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -5,7 +5,7 @@ include(cotire) project(rpcs3) -# Generate git-version.cpp at build time. +# Generate git-version.h at build time. add_custom_target(GitVersion ALL DEPENDS something_that_never_exists) add_custom_command(OUTPUT something_that_never_exists diff --git a/rpcs3/git-version.cmake b/rpcs3/git-version.cmake index e6b5c86f90..1382a9cb18 100644 --- a/rpcs3/git-version.cmake +++ b/rpcs3/git-version.cmake @@ -1,4 +1,4 @@ -set(GIT_VERSION_FILE "${SOURCE_DIR}/git-version.h") +set(GIT_VERSION_FILE "${SOURCE_DIR}/rpcs3/git-version.h") set(GIT_VERSION "unknown") set(GIT_VERSION_UPDATE "1") From e61849c3c415c66ca564f018f79b44f212093425 Mon Sep 17 00:00:00 2001 From: Dante38490 Date: Thu, 15 Jan 2015 04:03:25 +0100 Subject: [PATCH 8/9] Fix correct name file --- rpcs3/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index c6eb5643db..c5e6ebe4a0 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -5,7 +5,7 @@ include(cotire) project(rpcs3) -# Generate git-version.cpp at build time. +# Generate git-version.h at build time. add_custom_target(GitVersion ALL DEPENDS something_that_never_exists) add_custom_command(OUTPUT something_that_never_exists From 0a7b9c03e4535e17dabf75d1b1659d31f3e729b7 Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Thu, 15 Jan 2015 04:18:44 +0100 Subject: [PATCH 9/9] Fix My error --- rpcs3/git-version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/git-version.cmake b/rpcs3/git-version.cmake index df74c6424e..3a764c50a4 100644 --- a/rpcs3/git-version.cmake +++ b/rpcs3/git-version.cmake @@ -1,4 +1,4 @@ -set(GIT_VERSION_FILE "${SOURCE_DIR}/rpcs3/git-version.h") +set(GIT_VERSION_FILE "${SOURCE_DIR}/git-version.h") set(GIT_VERSION "unknown") set(GIT_VERSION_UPDATE "1") @@ -39,4 +39,4 @@ set(code_string "// This is a generated file.\n\n" if ("${GIT_VERSION_UPDATE}" EQUAL "1") file(WRITE ${GIT_VERSION_FILE} ${code_string}) -endif() \ No newline at end of file +endif()