Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of build cleanups + updates #907

Merged
merged 8 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 43 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cache:
ccache: true # includes $HOME/.ccache and adds /usr/lib/ccache to $PATH
# directories:
# - 3rd_party # this is sometimes breaking subsequent Travis builds
dist: xenial
dist: bionic

notifications:
email: false
Expand All @@ -12,15 +12,36 @@ notifications:
env:
global:
# Ubuntu version
- LINUX_DIST=trusty
- LINUX_DIST=bionic
- DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
# Global build options and C++ flags
- CXX_FLAGS="-Wall -pedantic"
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- CASHER_TIME_OUT=1000
- QT=511

- QT=512

addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- cmake
- gcc-9
- g++-9
- ninja-build
homebrew:
packages:
- cmake
- gcc@9
- llvm@9
- ninja
- qt
- cppcheck
update: true

addons_shortcuts:
addons_clang50: &clang50
apt:
Expand All @@ -41,56 +62,42 @@ addons_shortcuts:

matrix:
include:
# - os: linux
# compiler: "clang-3.9"
# env: CLANG_VERSION=3.9 BUILD='Debug' CC=clang-3.9 CXX=clang++-3.9 LIBCXX=On
# addons: *clang39
# - os: linux
# compiler: "clang-4.0"
# env: CLANG_VERSION=4.0 BUILD='Debug' CC=clang-4.0 CXX=clang++-4.0 LIBCXX=On
# addons: *clang40
# - os: linux
# compiler: "clang-5.0"
# env: CLANG_VERSION=5.0 BUILD='Debug' CC=clang-5.0 CXX=clang++-5.0 LIBCXX=On
# CLANG_TIDY=clang-tidy-5.0
# addons: *clang50
# - os: linux
# compiler: "clang-5.0"
# env: CLANG_VERSION=5.0 BUILD='Debug' CC=clang-5.0 CXX=clang++-5.0 LIBCXX=On
# CXXFLAGS="-fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer ${CXXFLAGS}"
# LDFLAGS="-fsanitize=address,undefined,integer"
# addons: *clang50
- os: linux
compiler: "gcc-7"
env: BUILD='Debug' CC=gcc-7 CXX=g++-7
addons: *gcc7
dist: bionic
env: BUILD='Debug'
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
before_install:
- sudo add-apt-repository -y ppa:beineri/opt-qt-5.12.6-bionic
- sudo apt-get -q update
- sudo apt-get install -qq libgl1-mesa-dev qt512base qt512declarative qt512websockets qt512quickcontrols2
- curl -L https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-Linux-x86_64.tar.gz -o cmake-3.16.4-Linux-x86_64.tar.gz
- tar xf cmake-3.16.4-Linux-x86_64.tar.gz
- export PATH=${PWD}/cmake-3.16.4-Linux-x86_64/bin:${PATH}
- cmake --version
- os: osx
osx_image: xcode9.2
osx_image: xcode11.3
compiler: clang
env: BUILD='Debug'

before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y; fi
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get update -qq;
else
brew update;
fi
# - if [ -n "$CLANG_VERSION" ]; then sudo PATH="${PATH}" CXX="$CXX" CC="$CC" ./ci_support/install_libcxx.sh; fi

install:
# - |
# if [ "$LIBCXX" == "On" ]; then
# CXX_FLAGS="${CXX_FLAGS} -stdlib=libc++ -nostdinc++ -cxx-isystem /usr/include/c++/v1/ -Wno-unused-command-line-argument";
# CXX_LINKER_FLAGS="${CXX_LINKER_FLAGS} -lc++abi";
# fi
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq libgl1-mesa-dev qt512base qt512declarative qt512websockets qt512quickcontrols2; source /opt/qt512/bin/qt512-env.sh;
source /opt/qt512/bin/qt512-env.sh;
CMAKE_OPTS="";
else
brew install cppcheck qt;
brew link --force qt;
export PATH="/usr/local/opt/qt/bin:$PATH" # missing mkspecs fix
QT5_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qt/*/lib/cmake);
Expand Down
8 changes: 6 additions & 2 deletions 3rd_party/ExternalProject_ACE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ ExternalProject_Add(
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_STAGING_PREFIX:PATH=${ThirdParty_Install_Dir} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
BUILD_BYPRODUCTS ${ace_LIBRARY_SHARED} ${ace_LIBRARY_STATIC} ${ace_LIBRARY_IMP}
BUILD_BYPRODUCTS
${ace_LIBRARY_SHARED} ${ace_LIBRARY_IMP}
)
find_package(Threads)
ADD_LIBRARY(ace_IMP SHARED IMPORTED GLOBAL)
add_dependencies(ace_IMP ACE_BUILD)
set_shared_lib_properties(ace)

SET_PROPERTY(TARGET ace_IMP APPEND PROPERTY IMPORTED_LOCATION ${ace_LIBRARY_SHARED} )
SET_PROPERTY(TARGET ace_IMP APPEND PROPERTY IMPORTED_IMPLIB ${ace_LIBRARY_IMP} )

set_property(TARGET ace_IMP APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS ACE_HAS_DLL=1)
set_property(TARGET ace_IMP APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads)
message(${ace_LIBRARY_SHARED})
Expand Down
Binary file modified 3rd_party/naked_ace.tgz
Binary file not shown.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.16)
project(SEGS)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Tell cmake to honor CXX_VISIBILITY_PRESET and ignore it
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0065 NEW)
cmake_policy(SET CMP0072 NEW)
cmake_policy(SET CMP0079 NEW)

# for version and revision info. Derived from https://github.com/dolphin-emu/dolphin/blob/master/CMakeLists.txt#L132
find_package(Git)
if(GIT_FOUND)
Expand Down Expand Up @@ -88,7 +94,7 @@ add_subdirectory(3rd_party)
link_directories(${PROJECT_SOURCE_DIR}/lib) # ERICEDIT: Changed to lowercase.

include(LocateQt5)
find_package(Qt5 COMPONENTS Core Sql REQUIRED)
find_package(Qt5 5.12 COMPONENTS Core Sql REQUIRED)

if(ENABLE_TESTS)
enable_testing()
Expand Down
4 changes: 4 additions & 0 deletions CMakeScripts/LocateQt5.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SET(QT_MISSING True)
# msvc only; mingw will need different logic
IF(MSVC)
message("LocateQt5 was given a Qt5 path ${QT_GIVEN_PATH}")
# look for user-registry pointing to qtcreator
GET_FILENAME_COMPONENT(QT_BIN [HKEY_CURRENT_USER\\Software\\Classes\\Applications\\QtProject.QtCreator.cpp\\shell\\Open\\Command] PATH)
if(${MSVC_VERSION} VERSION_LESS "1910")
Expand Down Expand Up @@ -31,6 +32,9 @@ IF(MSVC)
endif()

SET(QT_PATH "${QT_VERSION}/msvc${QT_MSVC}")
if(QT_GIVEN_PATH)
set(QT_PATH "${QT_GIVEN_PATH}")
endif()
SET(QT_MISSING False)
file(TO_NATIVE_PATH "${QT_PATH}/bin" QT_BIN_DIR_WINDOWS)
set(CMAKE_MSVCIDE_RUN_PATH "${QT_BIN_DIR_WINDOWS}" CACHE STATIC "MSVC IDE Run path" FORCE)
Expand Down
4 changes: 4 additions & 0 deletions Projects/CoX/Common/GameData/seq_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@
#include <QMap>
#include <qobjectdefs.h>

// Qt 5.14 has built-in specialization for std hash on some of their types
#ifndef QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF
namespace std
{
template <> struct hash<QByteArray>
{
size_t operator()(const QByteArray &x) const { return qHash(x); }
};
} // namespace std
#endif

// WHY, WINDOWS, WHY ?
#ifdef FAR
#undef FAR
Expand Down
13 changes: 9 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
# - CMAKE_GENERATOR: "Visual Studio 15 2017"
# QT5: C:\Qt\5.10.1\msvc2015
- CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
QT5: C:\Qt\5.12.2\msvc2017_64
QT5: C:\Qt\5.12.6\msvc2017_64
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat

branches:
Expand All @@ -30,12 +30,17 @@ clone_depth: 5
matrix:
fast_finish: false # set this flag to immediately finish build once one of the jobs fails.

init:
- call "%QT5%\bin\qtenv2.bat"
- call "%VCVARS%"
- cd /D "%APPVEYOR_BUILD_FOLDER%"

before_build:
- if exist "%QT5%" set Path=%QT5%\bin;%Path%
- if exist "%QT5%" set PATH=%QT5%\bin;%PATH%
- md build
- cmake -H. -Bbuild -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QT5%"
- call "%VCVARS%"
- cmake -H. -Bbuild -G "%CMAKE_GENERATOR%" -DQT_GIVEN_PATH:STRING="%QT5%" "-DCMAKE_PREFIX_PATH=%QT5%"
- lib /def:Projects\CoX\Clients\patch_tools\CityOfX.def /OUT:Projects/CoX/Clients/patch_tools/CityOfX.lib

build_script:
- if "%APPVEYOR_REPO_TAG%"=="true" (set CONFIGURATION=RelWithDebInfo) else (set CONFIGURATION=Debug)
- cmake --build build --config "%CONFIGURATION%" -- %MSBUILD_FLAGS%
Expand Down
4 changes: 2 additions & 2 deletions docs/COH-CLIENT_INSTALL-UBUNTU.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Intel or Radeon card. If you're experienced in debugging on Windows we would be

Come and join us in `#pocket-d` channel for general chat or `#troubleshooting` for support.

[**Click here to join SEGS Discord**](https://discord.segs.dev/)
[**Click here to join SEGS Discord**](https://discord.segs.dev/)

Or if **IRC** chat is more your speed, you can join us on IRC:

**Server:** irc.segs.dev
**Server:** irc.segs.dev
**Port:** 6667
**SSL port:** 6697
**Channel:** #segs
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Q. How do I create my own server?

A. Well, it’s not a complete server. More like 5%. By if you want
to try what we have, you can download a Windows EXE file, or compile the code using
QT Creator version 5.8+. Then using the I0 client, and an app to tell it what address
QT Creator with Qt 5.12+. Then using the I0 client, and an app to tell it what address
to connect to, login, create a character and be in Atlas Park. More detailed
instructions are in the Readme on our GitHub page.

Expand Down
6 changes: 3 additions & 3 deletions docs/SEGS-COMPILE_AND_INSTALL-CENTOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ REQUIREMENTS AND NOTES

Below are the utilities and libraries you'll need to compile SEGS in any environment. While it may be possible to use another toolset, the C++ Tool Chain below is the only one officially supported by the SEGS team. These packages are available for both Linux or Windows, via your distro's package manager, or via the links below:

- **QT 5.9+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/
- **QT 5.12+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/

- **CMake 3.6+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **CMake 3.16+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **Git** - A version control system for tracking changes in computer files and coordinating work on those files among multiple people. https://git-scm.com/download

**ADVANCED:** By default SEGS uses a local SQLite database created by `SEGSAdmin` or `dbtool`, but optionally may be configured to use another database driver by manually configuring settings.cfg. SEGS is compatible with PostGreSQL or MySQL/MariaDB. These alternate configurations are optional and unsupported. YMMV.
Expand Down Expand Up @@ -44,7 +44,7 @@ yum install devtoolset-6-gcc-c++
source /opt/rh/devtoolset-6/enable
```

Your distro may come with some or all of these packages pre-installed, and while most versions of these libraries will work, you must have version 5.8+ of Qt installed. CentOS and RHEL are two such distributions that require downloading a more recent version of CMake and Qt and potentially having to build from source.
Your distro may come with some or all of these packages pre-installed, and while most versions of these libraries will work, you must have version 5.12+ of Qt installed. CentOS and RHEL are two such distributions that require downloading a more recent version of CMake and Qt and potentially having to build from source.


BUILD SEGS
Expand Down
6 changes: 3 additions & 3 deletions docs/SEGS-COMPILE_AND_INSTALL-FEDORA.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ REQUIREMENTS AND NOTES

Below are the utilities and libraries you'll need to compile SEGS in any environment. While it may be possible to use another toolset, the C++ Tool Chain below is the only one officially supported by the SEGS team. These packages are available for both Linux or Windows, via your distro's package manager, or via the links below:

- **QT 5.9+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/
- **QT 5.12+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/

- **CMake 3.6+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **CMake 3.16+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **Git** - A version control system for tracking changes in computer files and coordinating work on those files among multiple people. https://git-scm.com/download

**ADVANCED:** By default SEGS uses a local SQLite database created by `SEGSAdmin` or `dbtool`, but optionally may be configured to use another database driver by manually configuring settings.cfg. SEGS is compatible with PostGreSQL or MySQL/MariaDB. These alternate configurations are optional and unsupported. YMMV.
Expand Down Expand Up @@ -42,7 +42,7 @@ Install all dependencies and tools by opening a terminal and typing:
sudo dnf install cmake gcc gcc-c++ git-core kernel-devel qt5 qt5-devel
```

Your distro may come with some or all of these packages pre-installed, and while most versions of these libraries will work, you must have version 5.8+ of Qt installed. CentOS and RHEL are two such distributions that require downloading a more recent version of CMake and Qt and potentially having to build from source.
Your distro may come with some or all of these packages pre-installed, and while most versions of these libraries will work, you must have version 5.12+ of Qt installed. CentOS and RHEL are two such distributions that require downloading a more recent version of CMake and Qt and potentially having to build from source.

BUILD SEGS
------
Expand Down
4 changes: 2 additions & 2 deletions docs/SEGS-COMPILE_AND_INSTALL-FREEBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ REQUIREMENTS AND NOTES

Below are the utilities and libraries you'll need to compile SEGS in any environment. While it may be possible to use another toolset, the C++ Tool Chain below is the only one officially supported by the SEGS team. These packages are available for both Linux or Windows, via your distro's package manager, or via the links below:

- **QT 5.9+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/
- **QT 5.12+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/

- **CMake 3.6+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **CMake 3.16+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **Git** - A version control system for tracking changes in computer files and coordinating work on those files among multiple people. https://git-scm.com/download

**ADVANCED:** By default SEGS uses a local SQLite database created by `SEGSAdmin` or `dbtool`, but optionally may be configured to use another database driver by manually configuring settings.cfg. SEGS is compatible with PostGreSQL or MySQL/MariaDB. These alternate configurations are optional and unsupported. YMMV.
Expand Down
4 changes: 2 additions & 2 deletions docs/SEGS-COMPILE_AND_INSTALL-WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ REQUIREMENTS AND NOTES

Below are the utilities and libraries you'll need to compile SEGS in any environment. While it may be possible to use another toolset, the C++ Tool Chain below is the only one officially supported by the SEGS team. These packages are available for both Linux or Windows via the links below:

- **QT 5.9+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/
- **QT 5.12+** - A cross platform application framework utilized heavily by SEGS. http://download.qt.io/archive/qt/

- **CMake 3.6+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **CMake 3.16+** - CMake is the cross-platform make utility. It generates makefiles for multiple platforms. https://cmake.org/download/
- **Git** - A version control system for tracking changes in computer files and coordinating work on those files among multiple people. https://git-scm.com/download

**ADVANCED:** By default SEGS uses a local SQLite database created by `SEGSAdmin` or `dbtool`, but optionally may be configured to use another database driver by manually configuring settings.cfg. SEGS is compatible with PostGreSQL or MySQL/MariaDB. These alternate configurations are optional and unsupported. YMMV.
Expand Down