From de2513653e10af6648434aaf12f92bafbf5fb4fc Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 26 May 2018 19:51:50 +0400 Subject: [PATCH 1/4] AppVeyor: build with Release configuration --- CI/before_script.msvc.sh | 15 +++++++++++++-- CMakeLists.txt | 5 +---- appveyor.yml | 17 +++++++++-------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 9c12c45db..16def0f8c 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -636,6 +636,17 @@ fi -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \ -DCMAKE_PREFIX_PATH="$QT_SDK" + if [ $CONFIGURATION == "Debug" ]; then + SUFFIX="d" + else + SUFFIX="" + fi + + DIR=$(echo "${QT_SDK}" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,") + + add_runtime_dlls "${DIR}/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${SUFFIX}.dll + add_qt_platform_dlls "${DIR}/plugins/platforms/qwindows${SUFFIX}.dll" + echo Done. fi } @@ -710,7 +721,7 @@ if [ ! -z $CI ]; then fi # NOTE: Disable this when/if we want to run test cases -if [ -z $CI ]; then +#if [ -z $CI ]; then echo "- Copying Runtime DLLs..." mkdir -p $BUILD_CONFIG for DLL in $RUNTIME_DLLS; do @@ -742,7 +753,7 @@ if [ -z $CI ]; then cp "$DLL" "${BUILD_CONFIG}/platforms" done echo -fi +#fi if [ -z $VERBOSE ]; then printf -- "- Configuring... " diff --git a/CMakeLists.txt b/CMakeLists.txt index bfef2d328..3cd1082f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -360,8 +360,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter") endif() elseif (MSVC) - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /Zi /bigobj") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO") # Enable link-time code generation globally for all linking if (OPENMW_LTO_BUILD) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") @@ -707,8 +705,7 @@ if (WIN32) endif() if (BUILD_OPENMW) - # Very specific issue this, only needed on 32-bit VS2015 during unity builds. - if (MSVC_VERSION GREATER 1800 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND OPENMW_UNITY_BUILD) + if (OPENMW_UNITY_BUILD) set_target_properties(openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD} /bigobj") else() set_target_properties(openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") diff --git a/appveyor.yml b/appveyor.yml index 21fb7e1d6..97eaa0e26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,8 @@ platform: configuration: # - Debug - - Release + - Release +# - RelWithDebInfo # For the Qt, Boost, CMake, etc installs #os: Visual Studio 2017 @@ -48,7 +49,7 @@ install: - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% before_build: - - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% -v %msvc% -V + - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -c %configuration% -p %PLATFORM% -v %msvc% -V build_script: - cmd: if %PLATFORM%==Win32 set build=MSVC%msvc%_32 @@ -56,8 +57,8 @@ build_script: - cmd: msbuild %build%\OpenMW.sln /t:Build /p:Configuration=%configuration% /m:2 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" after_build: - - cmd: if %PLATFORM%==x64 7z a OpenMW_MSVC%msvc%_x64.zip %APPVEYOR_BUILD_FOLDER%\MSVC%msvc%_64\Release\ -xr"!*.pdb" - - cmd: if %PLATFORM%==x64 7z a OpenMW_MSVC%msvc%_x64_pdb.zip %APPVEYOR_BUILD_FOLDER%\MSVC%msvc%_64\Release\*.pdb + - cmd: if %PLATFORM%==x64 7z a OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit%.zip %APPVEYOR_BUILD_FOLDER%\MSVC%msvc%_64\%configuration%\ -xr"!*.pdb" + #- cmd: if %PLATFORM%==x64 7z a OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit%_pdb.zip %APPVEYOR_BUILD_FOLDER%\MSVC%msvc%_64\%configuration%\*.pdb test: off @@ -69,7 +70,7 @@ test: off # on_build_status_changed: true artifacts: - - path: OpenMW_MSVC%msvc%_x64.zip - name: OpenMW_MSVC%msvc%_x64 - - path: OpenMW_MSVC%msvc%_x64_pdb.zip - name: OpenMW_MSVC%msvc%_x64_pdb + - path: OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit%.zip + name: OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit% + #- path: OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit%_pdb.zip + # name: OpenMW_MSVC%msvc%_%platform%_%appveyor_pull_request_number%_%appveyor_pull_request_head_commit%_pdb From dba79f4d4dd2e59f3f1ce41c9dacdd55c99c32eb Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 2 Jun 2018 14:28:05 +0300 Subject: [PATCH 2/4] Fix warnings: catching polymorphic type by value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openmw/apps/openmw/mwworld/worldimp.cpp: In member function ‘virtual bool MWWorld::World::findExteriorPosition(const string&, ESM::Position&)’: openmw/apps/openmw/mwworld/worldimp.cpp:2650:25: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=] catch (std::invalid_argument) ^~~~~~~~~~~~~~~~ openmw/apps/openmw/mwworld/worldimp.cpp:2654:25: warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=] catch (std::out_of_range) ^~~~~~~~~~~~ openmw/components/widgets/numericeditbox.cpp: In member function ‘void Gui::NumericEditBox::onEditTextChange(MyGUI::EditBox*)’: openmw/components/widgets/numericeditbox.cpp:41:21: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=] catch (std::invalid_argument) ^~~~~~~~~~~~~~~~ openmw/components/widgets/numericeditbox.cpp:45:21: warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=] catch (std::out_of_range) ^~~~~~~~~~~~ --- apps/openmw/mwworld/worldimp.cpp | 4 ++-- components/widgets/numericeditbox.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 6cf1ead87..6579996d2 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2601,11 +2601,11 @@ namespace MWWorld int y = std::stoi(name.substr(name.find(',')+1)); ext = getExterior(x, y)->getCell(); } - catch (std::invalid_argument) + catch (const std::invalid_argument&) { // This exception can be ignored, as this means that name probably refers to a interior cell instead of comma separated coordinates } - catch (std::out_of_range) + catch (const std::out_of_range&) { throw std::runtime_error("Cell coordinates out of range."); } diff --git a/components/widgets/numericeditbox.cpp b/components/widgets/numericeditbox.cpp index ee2c30a7b..efe480653 100644 --- a/components/widgets/numericeditbox.cpp +++ b/components/widgets/numericeditbox.cpp @@ -38,11 +38,11 @@ namespace Gui setCaption(MyGUI::utility::toString(mValue)); } } - catch (std::invalid_argument) + catch (const std::invalid_argument&) { setCaption(MyGUI::utility::toString(mValue)); } - catch (std::out_of_range) + catch (const std::out_of_range&) { setCaption(MyGUI::utility::toString(mValue)); } From eecde340cf33dbf2d30a696e68948253c710f01e Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 2 Jun 2018 15:41:05 +0300 Subject: [PATCH 3/4] Make weapon health short unsigned (fixes #4435) --- components/esm/loadweap.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esm/loadweap.hpp b/components/esm/loadweap.hpp index eddcaee4f..8b48b71b7 100644 --- a/components/esm/loadweap.hpp +++ b/components/esm/loadweap.hpp @@ -57,7 +57,7 @@ struct Weapon float mWeight; int mValue; short mType; - short mHealth; + unsigned short mHealth; float mSpeed, mReach; short mEnchant; // Enchantment points. The real value is mEnchant/10.f unsigned char mChop[2], mSlash[2], mThrust[2]; // Min and max From c71df7249da6295774df2c3f156730157ef9c792 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 26 May 2018 16:09:12 +0300 Subject: [PATCH 4/4] Fix UTF-8 econding To be able run gcovr --- extern/oics/ICSInputControlSystem_mouse.cpp | 4 ++-- extern/oics/tinystr.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extern/oics/ICSInputControlSystem_mouse.cpp b/extern/oics/ICSInputControlSystem_mouse.cpp index 5decaf1eb..e389bc981 100644 --- a/extern/oics/ICSInputControlSystem_mouse.cpp +++ b/extern/oics/ICSInputControlSystem_mouse.cpp @@ -268,11 +268,11 @@ namespace ICS ctrl->setIgnoreAutoReverse(true); if(mouseBinderItem.direction == Control::INCREASE) { - ctrl->setValue( float( (evt.state.Z.abs) / float(evt.state.¿width?) ) ); + ctrl->setValue( float( (evt.state.Z.abs) / float(evt.state.¿width?) ) ); } else if(mouseBinderItem.direction == Control::DECREASE) { - ctrl->setValue( float( (1 - evt.state.Z.abs) / float(evt.state.¿width?) ) ); + ctrl->setValue( float( (1 - evt.state.Z.abs) / float(evt.state.¿width?) ) ); } }*/ } diff --git a/extern/oics/tinystr.cpp b/extern/oics/tinystr.cpp index 681250714..635e84b5f 100644 --- a/extern/oics/tinystr.cpp +++ b/extern/oics/tinystr.cpp @@ -23,7 +23,7 @@ distribution. */ /* - * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. + * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. */