From f3187b17c83d0196b2b580b0122a938743f28770 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 23 Dec 2015 18:38:53 +0100 Subject: [PATCH 01/14] Update OpenAL soft link, get qtbinpatcher to run --- CI/before_script.msvc.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 37905fc4c..50fd13e4e 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -225,7 +225,7 @@ if [ -z $SKIP_DOWNLOAD ]; then # OpenAL download "OpenAL-Soft 1.16.0" \ - http://kcat.strangesoft.net/openal-soft-1.16.0-bin.zip \ + http://kcat.strangesoft.net/openal-binaries/openal-soft-1.16.0-bin.zip \ OpenAL-Soft-1.16.0.zip # OSG @@ -472,10 +472,8 @@ fi rm -rf Qt eval 7z x -y $DEPS/qt$BITS-4.8.6.7z $STRIP mv qt-4.8.6-* Qt - ( - cd $QT_SDK - eval qtbinpatcher.exe $STRIP - ) + cd Qt + eval ./qtbinpatcher.exe $STRIP fi cd $QT_SDK From 5743c839a8bd40fa9336c7dacdaae4c59b1ef7ee Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 23 Dec 2015 18:51:04 +0100 Subject: [PATCH 02/14] Why is this breaking on AppVeyor? --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 651f41783..be8f2b12b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,7 +40,7 @@ cache: clone_folder: C:\projects\openmw before_build: - - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u + - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -v build_script: - cmd: if %PLATFORM%==Win32 set build=Build_32 From c226d015aca698cb8ac95f8ee6571f36c2946248 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 23 Dec 2015 18:59:41 +0100 Subject: [PATCH 03/14] AppVeyor doesn't pass the platform env variable? --- CI/before_script.msvc.sh | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 50fd13e4e..3cb024dda 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -40,7 +40,7 @@ else cd $APPVEYOR_BUILD_FOLDER VERSION="$(cat README.md | grep Version: | awk '{ print $3; }')-$(git rev-parse --short HEAD)" - appveyor UpdateBuild -Version "$VERSION" + appveyor UpdateBuild -Version "$VERSION" > /dev/null & fi run_cmd() { diff --git a/appveyor.yml b/appveyor.yml index be8f2b12b..b137d4850 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,7 +40,7 @@ cache: clone_folder: C:\projects\openmw before_build: - - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -v + - cmd: sh PLATFORM=%PLATFORM% %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u build_script: - cmd: if %PLATFORM%==Win32 set build=Build_32 From c8145a1b917d81639577cfb7c6018d0d786b7b73 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Wed, 23 Dec 2015 19:32:43 +0100 Subject: [PATCH 04/14] Let's see if we can't get AppVeyor to work --- CI/before_script.msvc.sh | 8 ++++++++ appveyor.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 3cb024dda..51734ceb3 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -20,6 +20,14 @@ while [ $# -gt 0 ]; do -u ) UNITY_BUILD=true ;; + -p ) + PLATFORM=$1 + shift ;; + + -c ) + CONFIGURATION=$1 + shift ;; + * ) echo "Unknown arg $ARG." exit 1 ;; diff --git a/appveyor.yml b/appveyor.yml index b137d4850..46241bf29 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,7 +40,7 @@ cache: clone_folder: C:\projects\openmw before_build: - - cmd: sh PLATFORM=%PLATFORM% %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u + - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% build_script: - cmd: if %PLATFORM%==Win32 set build=Build_32 From 1dbc1e67d8cd4f2807792bac7aa3e83d5fa274b3 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 02:41:35 +0100 Subject: [PATCH 05/14] Possible Qt5 link fix for AppVeyor --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e966a163..d75d044b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,8 +99,8 @@ if (WIN32) option(USE_DEBUG_CONSOLE "whether a debug console should be enabled for debug builds, if false debug output is redirected to Visual Studio output" ON) endif() -# We probably support older versions than this. -cmake_minimum_required(VERSION 2.6) +# To make Qt5 happy and allow linking QtMain on Windows. +cmake_minimum_required(VERSION 2.8.11) # Sound setup unset(FFMPEG_LIBRARIES CACHE) From 2142d0d2d65c40155be00e49578eea5e60a25080 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 02:48:00 +0100 Subject: [PATCH 06/14] Make Qt5 happy --- apps/launcher/CMakeLists.txt | 3 --- apps/opencs/CMakeLists.txt | 3 --- apps/wizard/CMakeLists.txt | 3 --- 3 files changed, 9 deletions(-) diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt index 274239fb0..4d2dc6ac4 100644 --- a/apps/launcher/CMakeLists.txt +++ b/apps/launcher/CMakeLists.txt @@ -103,9 +103,6 @@ if (DESIRED_QT_VERSION MATCHES 4) endif(WIN32) else() qt5_use_modules(openmw-launcher Widgets Core) - if (WIN32) - target_link_libraries(Qt5::WinMain) - endif() endif() if (BUILD_WITH_CODE_COVERAGE) diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 6af04e8fc..a8ed68328 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -224,9 +224,6 @@ if (DESIRED_QT_VERSION MATCHES 4) endif() else() qt5_use_modules(openmw-cs Widgets Core Network OpenGL) - if (WIN32) - target_link_libraries(Qt5::WinMain) - endif() endif() if (WIN32) diff --git a/apps/wizard/CMakeLists.txt b/apps/wizard/CMakeLists.txt index 89438640c..4be5fb2b7 100644 --- a/apps/wizard/CMakeLists.txt +++ b/apps/wizard/CMakeLists.txt @@ -129,9 +129,6 @@ if (DESIRED_QT_VERSION MATCHES 4) endif() else() qt5_use_modules(openmw-wizard Widgets Core) - if (WIN32) - target_link_libraries(Qt5::WinMain) - endif() endif() if (OPENMW_USE_UNSHIELD) From 93ee8f1991beeeb8a1822164df502f2cf940001e Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 11:33:59 +0100 Subject: [PATCH 07/14] Allow for earlier CMake on Qt4 --- CMakeLists.txt | 57 +++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 906c87db2..509988fef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,8 +111,37 @@ if (WIN32) option(USE_DEBUG_CONSOLE "whether a debug console should be enabled for debug builds, if false debug output is redirected to Visual Studio output" ON) endif() -# To make Qt5 happy and allow linking QtMain on Windows. -cmake_minimum_required(VERSION 2.8.11) +if (NOT BUILD_LAUNCHER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD) + set(USE_QT FALSE) +else() + set(USE_QT TRUE) +endif() + +# Dependencies +if (USE_QT) + set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") + set_property(CACHE DESIRED_QT_VERSION PROPERTY STRINGS 4 5) + message(STATUS "Using Qt${DESIRED_QT_VERSION}") + + if (DESIRED_QT_VERSION MATCHES 4) + find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) + else() + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Core REQUIRED) + find_package(Qt5Network REQUIRED) + find_package(Qt5OpenGL REQUIRED) + # Instruct CMake to run moc automatically when needed. + #set(CMAKE_AUTOMOC ON) + endif() +endif() + +if (USE_QT AND DESIRED_QT_VERSION MATCHES 5) + # 2.8.11+ is required to make Qt5 happy and allow linking QtMain on Windows. + cmake_minimum_required(VERSION 2.8.11) +else() + # We probably support older versions than this. + cmake_minimum_required(VERSION 2.6) +endif() # Sound setup unset(FFMPEG_LIBRARIES CACHE) @@ -167,30 +196,6 @@ if (OPENGL_ES) add_definitions(-DOPENGL_ES) endif(OPENGL_ES) -if (NOT BUILD_LAUNCHER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD) - set(USE_QT FALSE) -else() - set(USE_QT TRUE) -endif() - -# Dependencies -if (USE_QT) - set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") - set_property(CACHE DESIRED_QT_VERSION PROPERTY STRINGS 4 5) - message(STATUS "Using Qt${DESIRED_QT_VERSION}") - - if (DESIRED_QT_VERSION MATCHES 4) - find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) - else() - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Core REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5OpenGL REQUIRED) - # Instruct CMake to run moc automatically when needed. - #set(CMAKE_AUTOMOC ON) - endif() -endif() - # Fix for not visible pthreads functions for linker with glibc 2.15 if (UNIX AND NOT APPLE) find_package (Threads) From 09ec622f66d0d4e970c8a32165161d7aa4acdb94 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 11:42:12 +0100 Subject: [PATCH 08/14] Remove unused environment, only do 32-bit --- appveyor.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 46241bf29..631cae63a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,18 +6,10 @@ branches: platform: - Win32 - - x64 +# - x64 configuration: Debug -#environment: -# matrix: -# - STEP: misc -# - STEP: components # misc builds this too -# Build takes too long for these, ignore for now -# - STEP: openmw -# - STEP: opencs - matrix: fast_finish: true From f422fe49f8b2f07bec6e4fcd9950fd15ac9bb7f3 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 18:27:57 +0100 Subject: [PATCH 09/14] Slight improvement to the build setup --- CI/before_script.msvc.sh | 121 ++++++++++++++++++++++++++++----------- appveyor.yml | 3 +- 2 files changed, 91 insertions(+), 33 deletions(-) mode change 100644 => 100755 CI/before_script.msvc.sh diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh old mode 100644 new mode 100755 index 51734ceb3..5aa8d3e9d --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -1,42 +1,86 @@ #!/bin/bash while [ $# -gt 0 ]; do - ARG=$1 + ARGSTR=$1 shift - case $ARG in - -v ) - VERBOSE=true ;; - - -d ) - SKIP_DOWNLOAD=true ;; - - -e ) - SKIP_EXTRACT=true ;; - - -k ) - KEEP=true ;; - - -u ) - UNITY_BUILD=true ;; - - -p ) - PLATFORM=$1 - shift ;; - - -c ) - CONFIGURATION=$1 - shift ;; + if [ ${ARGSTR:0:1} != "-" ]; then + echo "Unknown argument $ARGSTR" + echo "Try '$0 -h'" + exit 1 + fi - * ) - echo "Unknown arg $ARG." - exit 1 ;; - esac + for (( i=1; i<${#ARGSTR}; i++ )); do + ARG=${ARGSTR:$i:1} + case $ARG in + V ) + VERBOSE=true ;; + + v ) + VS_VERSION=$1 + shift ;; + + d ) + SKIP_DOWNLOAD=true ;; + + e ) + SKIP_EXTRACT=true ;; + + k ) + KEEP=true ;; + + u ) + UNITY_BUILD=true ;; + + p ) + PLATFORM=$1 + shift ;; + + c ) + CONFIGURATION=$1 + shift ;; + + h ) + cat < + Set the configuration, can also be set with environment variable CONFIGURATION. + -d + Skip checking the downloads. + -e + Skip extracting dependencies. + -h + Show this message. + -k + Keep the old build directory, default is to delete it. + -p + Set the build platform, can also be set with environment variable PLATFORM. + -u + Configure for unity builds. + -v <2013/2015> + Choose the Visual Studio version to use. + -V + Run verbosely +EOF + exit 0 + ;; + + * ) + echo "Unknown argument $ARG." + echo "Try '$0 -h'" + exit 1 ;; + esac + done done if [ -z $VERBOSE ]; then STRIP="> /dev/null 2>&1" fi +if [ -z $VS_VERSION ]; then + VS_VERSION="2013" +fi if [ -z $APPVEYOR ]; then echo "Running prebuild outside of Appveyor." @@ -148,14 +192,27 @@ if [ -z $CONFIGURATION ]; then CONFIGURATION="Debug" fi +case $VS_VERSION in + 14|2015 ) + GENERATOR="Visual Studio 14 2015" + XP_TOOLSET="v140_xp" + ;; + +# 12|2013| + * ) + GENERATOR="Visual Studio 12 2013" + XP_TOOLSET="v120_xp" + ;; +esac + case $PLATFORM in x64|x86_64|x86-64|win64|Win64 ) ARCHNAME=x86-64 ARCHSUFFIX=64 BITS=64 - BASE_OPTS="-G\"Visual Studio 12 2013 Win64\"" - add_cmake_opts "-G\"Visual Studio 12 2013 Win64\"" + BASE_OPTS="-G\"$GENERATOR Win64\"" + add_cmake_opts "-G\"$GENERATOR Win64\"" ;; x32|x86|i686|i386|win32|Win32 ) @@ -163,8 +220,8 @@ case $PLATFORM in ARCHSUFFIX=86 BITS=32 - BASE_OPTS="-G\"Visual Studio 12 2013\" -Tv120_xp" - add_cmake_opts "-G\"Visual Studio 12 2013\"" -Tv120_xp + BASE_OPTS="-G\"$GENERATOR\" -T$XP_TOOLSET" + add_cmake_opts "-G\"$GENERATOR\"" -T$XP_TOOLSET ;; * ) diff --git a/appveyor.yml b/appveyor.yml index 631cae63a..0667e0ee0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,8 @@ matrix: os: unstable -clone_depth: 1 +shallow_clone: true +#clone_depth: 1 cache: - C:\projects\openmw\deps\Bullet-2.83.5-win32.7z From d32358558e91b889cebb79873a5a4bf8b41ac63b Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 22:39:07 +0100 Subject: [PATCH 10/14] We actually want the commit hash, so no zips --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0667e0ee0..28df364df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,8 +15,8 @@ matrix: os: unstable -shallow_clone: true -#clone_depth: 1 +#shallow_clone: true +clone_depth: 1 cache: - C:\projects\openmw\deps\Bullet-2.83.5-win32.7z From 1ac091e5b5c0200356bdb50e3d23fe606f834703 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sun, 27 Dec 2015 20:00:52 +0100 Subject: [PATCH 11/14] Quick appveyor.yml cleanup --- appveyor.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 28df364df..1bc0d3ca6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,8 @@ version: "{build}" branches: only: + - master + - /openmw-.*$/ - appveyor platform: @@ -13,9 +15,11 @@ configuration: Debug matrix: fast_finish: true +# For the Qt, Boost, CMake, etc installs os: unstable -#shallow_clone: true +# We want the git revision for versioning, +# so shallow clones don't work. clone_depth: 1 cache: @@ -41,3 +45,10 @@ build_script: - cmd: msbuild %build%\OpenMW.sln /t:Build /p:Configuration=%configuration% /m:2 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" test: off + +#notifications: +# - provider: Email +# to: +# - +# on_build_failure: true +# on_build_status_changed: true From d5196ac4fc3ea94646023e1ee0c59a9eeac39c55 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Sun, 27 Dec 2015 20:05:37 +0100 Subject: [PATCH 12/14] Let's throw in a build badge too --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f353cd76e..585805368 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ OpenMW ====== -[![Build Status](https://img.shields.io/travis/OpenMW/openmw.svg)](https://travis-ci.org/OpenMW/openmw) [![Coverity Scan Build Status](https://scan.coverity.com/projects/3740/badge.svg)](https://scan.coverity.com/projects/3740) +[![Build Status](https://img.shields.io/travis/OpenMW/openmw.svg)](https://travis-ci.org/OpenMW/openmw) [![Build status](https://ci.appveyor.com/api/projects/status/e6bqw8oouy8ufd46?svg=true)](https://ci.appveyor.com/project/ace13/openmw) [![Coverity Scan Build Status](https://scan.coverity.com/projects/3740/badge.svg)](https://scan.coverity.com/projects/3740) OpenMW is a recreation of the engine for the popular role-playing game Morrowind by Bethesda Softworks. You need to own and install the original game for OpenMW to work. From 05335491ac82a78f1fe050f3b84478df0e61442d Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Mon, 28 Dec 2015 05:42:21 +0100 Subject: [PATCH 13/14] Build without unity builds, how far will we get? --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1bc0d3ca6..3e3de6780 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,7 @@ cache: clone_folder: C:\projects\openmw before_build: - - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% + - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -p %PLATFORM% build_script: - cmd: if %PLATFORM%==Win32 set build=Build_32 From 42e3ff6f962dc68296b12ee693871d7f9201cc07 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Mon, 28 Dec 2015 09:01:08 +0100 Subject: [PATCH 14/14] Revert "Build without unity builds, how far will we get?" This reverts commit 05335491ac82a78f1fe050f3b84478df0e61442d. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3e3de6780..1bc0d3ca6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,7 @@ cache: clone_folder: C:\projects\openmw before_build: - - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -p %PLATFORM% + - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% build_script: - cmd: if %PLATFORM%==Win32 set build=Build_32