Skip to content

(dev) Fix cmake build to use C++11 as well#420

Merged
vadi2 merged 4 commits intoMudlet:developmentfrom
vadi2:(dev)-make-cmake-use-cpp11
Mar 14, 2017
Merged

(dev) Fix cmake build to use C++11 as well#420
vadi2 merged 4 commits intoMudlet:developmentfrom
vadi2:(dev)-make-cmake-use-cpp11

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Mar 13, 2017

This necessitated updating minimum CMake version to one released in 2014 which I don't think would be an issue.

This necessitated updating minimum CMake version to one released in 2014 which I don't think would be an issue.
@vadi2 vadi2 requested a review from SlySven March 13, 2017 01:38
@vadi2 vadi2 removed the request for review from SlySven March 13, 2017 01:58
@vadi2 vadi2 changed the title Fix cmake build to use C++11 as well (dev) Fix cmake build to use C++11 as well Mar 13, 2017
ELSE()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you absolutely sure you HAVE to have 3.1 on all platforms (given that we only have 2.8.11.2 on the Linux Travis CI Platform)

ENDIF()
ENDIF()

set(CMAKE_CXX_STANDARD 11)
Copy link
Copy Markdown
Member

@SlySven SlySven Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 As I understand it this requires CMake 3.1 (see above) however it might be possible to code around this {see this answer on Stack Exchange}...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake 3.1 came out in 2014, I don't think it is a problem to upgrade to it. I'm sure we can find a PPA for Travis to use.

I don't want to add workarounds for ancient software, let's start using the new stuff!

Copy link
Copy Markdown
Member

@SlySven SlySven Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough - but I think it already is!

Checking ./CI/travis.linux/before_install.sh:

#!/bin/bash
set -ev
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa -y
# The ubuntu team have relocated the old qt 5.0.2 (and other things) from the above to:
sudo apt-add-repository ppa:canonical-qt5-edgers/ubuntu1204-qt5 -y
sudo apt-add-repository ppa:kalakris/cmake -y
# newer GCC version, 4.7
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo add-apt-repository ppa:boost-latest/ppa -y
sudo apt-get update
pushd $HOME
git clone https://github.com/lloyd/yajl.git
popd

There has not been any later updates to https://launchpad.net/~kalakris/+archive/ubuntu/cmake/+packages

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... we'll add a better PPA. We have the technology!

(and if not I'll add the workaround, ok)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... OK! 😀

Copy link
Copy Markdown
Member

@SlySven SlySven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a workaround to keep Travis working on the Linux-GCC-CMake combination.

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Mar 13, 2017

Bother - we need to install/replace cmake-data package as well as the cmake one, in ./CI/travis.linux.install.sh

#!/bin/bash
set -ev
sudo apt-get remove \
qt4-qmake libqt4-designer libqt4-dev libboost-dev
sudo apt-get autoremove
# libboost seems messed up in Precise 12.04 lts it mixes 1.46 and 1.48 so try
# and force a uniform 1.55 installation
sudo apt-get install \
build-essential \
qt5-default qtmultimedia5-dev qttools5-dev \
libhunspell-dev \
lua5.1 liblua5.1-0-dev \
libpcre3-dev \
libboost1.55-dev \
zlib1g-dbg zlib1g-dev \
libzip-dev \
libpulse-dev \
cmake \
gcc-4.7 \
g++-4.7
sudo update-alternatives --remove gcc /usr/bin/gcc-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
pushd $HOME/yajl
./configure
sudo make install
popd

🪲 Current install phase fails because cmake-data is held at the 2.8.11.2 version and breaks the cmake 3.x ...

Remove default packages that come with precise by default on travis, as we'd like to upgrade it to cmake from ppa (which does not use a corresponding cmake-data)
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Mar 13, 2017

Well, that'll probably work - I'm just surprised you didn't just add cmake and cmake-data to line 4 of ./CI/travis.linux.install.sh where other things are already being removed. 😜

@SlySven SlySven self-requested a review March 13, 2017 19:17
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Mar 13, 2017

Puzzling, the Travis CI is not picking up on the changes and I cannot see how to get it to recognise that a new commit has hit the PR and to thus rerun. Notably I somehow copied the Mudlet repository badge/code into my own repository and when I push to my repo Travis runs on it there as well as (redundantly perhaps) also running on the same code in the Mudlet Repository.

Or it could be that there is a current situation on Travis according to the Status page.

Missing build requests for Pull Requests
Investigating - We've found and are currently investigating reports of missing builds for pull request events
Mar 13, 19:35 UTC

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Mar 13, 2017 via email

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Mar 13, 2017

Expected Linux CI builds have now succeeded (MacOS ones are caught up in daily backlog due around this time but worked in the first commit) so Okaying this PR. I cannot recall but I do not think we mandate C++11 in the release_30 branch - otherwise we'd want the same Travis CI changes in there as well.

@vadi2 vadi2 merged commit 522ef97 into Mudlet:development Mar 14, 2017
@vadi2 vadi2 deleted the (dev)-make-cmake-use-cpp11 branch March 14, 2017 02:59
mehulmathur16 pushed a commit to mehulmathur16/Mudlet that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants