From d2fb69cda3e6dd94c6c13dc4834be4ff9e1b55f9 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 13 Aug 2017 21:38:37 +0300 Subject: [PATCH] Add build warning --- .travis.yml | 5 +++++ appveyor.yml | 3 +++ rpcs3/rpcs3qt/main_window.cpp | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/.travis.yml b/.travis.yml index d2617d963f..c04604b4cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,6 +68,11 @@ before_script: - mkdir build - cd build - export CMAKE_PREFIX_PATH=~/Qt/5.9.1/gcc_64/lib/cmake + - if [ "$TRAVIS_PULL_REQUEST" = false ]; then + export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH"; + else + export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/#$TRAVIS_PULL_REQUEST"; + fi; - cmake .. -DCMAKE_INSTALL_PREFIX=/usr; - make -j 3 - # AppImage generation diff --git a/appveyor.yml b/appveyor.yml index fd9b9682c5..df6fc976dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,9 @@ before_build: - git submodule update --init 3rdparty/ffmpeg 3rdparty/pugixml asmjit 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp 3rdparty/cereal 3rdparty/zlib 3rdparty/hidapi - 7z x zlib.7z -aos -oC:\rpcs3\ > null - 7z x vulkan.7z -aos -oC:\rpcs3\Vulkan > null + - if %APPVEYOR_PULL_REQUEST_NUMBER%=='' (set BRANCH=%APPVEYOR_REPO_NAME%/%APPVEYOR_REPO_BRANCH%) + else (set BRANCH=%APPVEYOR_REPO_NAME%/%APPVEYOR_REPO_BRANCH%/#%APPVEYOR_PULL_REQUEST_NUMBER%) + - set CXXFLAGS=-DBRANCH=%BRANCH% - if %configuration%==Release (cmake -G "Visual Studio 14 Win64" -DZLIB_ROOT=C:/rpcs3/zlib/ -DVULKAN_PREBUILT=ON) else (7z x llvmlibs.7z -aos -oC:\rpcs3 > null && cmake -G "Visual Studio 14 Win64" -DLLVM_DIR=C:/rpcs3/llvm_build/lib/cmake/llvm -DZLIB_ROOT=C:/rpcs3/zlib/ -DVULKAN_PREBUILT=ON) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 53f696074e..df84ce8525 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -109,6 +109,29 @@ void main_window::Init() std::exit(EXIT_FAILURE); } + +#ifdef BRANCH + if ("RPCS3/rpcs3/master"s != STRINGIZE(BRANCH)) +#elif _MSC_VER + fs::stat_t st; + if (!fs::stat(fs::get_config_dir() + "rpcs3.pdb", st) || st.is_directory || st.size < 1024 * 1024 * 100) +#else + if (true) +#endif + { + QMessageBox msg; + msg.setWindowTitle("Experimental Build Warning"); + msg.setIcon(QMessageBox::Critical); + msg.setTextFormat(Qt::RichText); + msg.setText("Please understand that this build is not an official RPCS3 release.
This build contains changes that may break games, or even damage your data.
It's recommended to download and use the official build from RPCS3 website.

Build origin: " STRINGIZE(BRANCH) "
Do you wish to use this build anyway?"); + msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + msg.setDefaultButton(QMessageBox::No); + + if (msg.exec() == QMessageBox::No) + { + std::exit(EXIT_SUCCESS); + } + } } void main_window::CreateThumbnailToolbar()