Travis-Ci Install and run CxxTest - c++

I am trying to add Travis-Ci support for my open source project hosted on Github
Problem appears when CMake tries to find CxxTest. Travis-Ci runs on old Ubuntu version, in which CxxTest is not trusted. I achieved some results. At this state CxxTest installs fine, but CMake is unable to find cxxtestgen.
Question: How do I correctly install and use CxxTest in Travis-Ci ?
Build log on Travis
Travis.yml
language: cpp
compiler:
- gcc
before_install:
- lsb_release -c
- lsb_release -r
- sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu vivid main universe multiverse restricted'
- sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty main universe multiverse restricted'
- sudo apt-key update
- sudo apt-get -y update
install:
- sudo apt-get --no-install-recommends -y install cxxtest;
- sudo find / -type f -name "cxxtestgen*"
- sudo ln /usr/share/cxxtest/cxxtest/cxxtestgen.py /usr/bin/cxxtestgen.py
- sudo find / -type f -name "cxxtestgen*"
- echo $PATH
before_script:
- cmake .
script: make
CMake log
$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find CxxTest (missing: CXXTEST_PERL_TESTGEN_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindCxxTest.cmake:179 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
test/CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
The command "cmake ." failed and exited with 1 during .
Your build has been stopped.

I found answer by myself.
language: cpp
compiler:
- gcc
cache:
apt: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55/cmake-3.x
packages:
- gcc-6
- g++-6
- libboost-dev
- gcc-multilib
- gcc-6-multilib
- g++-multilib
- g++-6-multilib
- libc6-dev-i386
- libc6-i386
- cxxtest
- cmake
before_install:
- echo `getconf _NPROCESSORS_ONLN`
- lsb_release -c
- lsb_release -r
install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi
before_script:
- cmake --version
- cmake .
script:
- make -j$((2 * `getconf _NPROCESSORS_ONLN`))
sudo: false
dist: trusty

Related

Building the AWS SDK from source on Amazon Linux 2

I am trying to follow up suggestion from aws-lamba-cpp to reduce complexity in building my application.
If you choose to build on the same Amazon Linux version used by
lambda, you can avoid packaging the C runtime in your zip file.
After reading:
Building the SDK from source on EC2
Here is what I tried:
% docker run -it amazonlinux:latest /bin/bash
$ cd /tmp/
$ yum -y install libcurl-devel openssl-devel libuuid-devel cmake3 wget tar gzip make gcc-c++
$ wget https://github.com/aws/aws-sdk-cpp/archive/refs/tags/1.9.9.tar.gz
$ tar xfz 1.9.9.tar.gz
$ cd aws-sdk-cpp-1.9.9/
$ mkdir build
$ cd build
$ cmake3 .. -DBUILD_ONLY=s3 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as shared objects
-- Generating linux build config
-- Building project version: 1.9.9
-- The CXX compiler identification is GNU 7.3.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Zlib library: /usr/lib64/libz.so
-- Encryption: Openssl
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.0.2k")
-- Openssl include directory: /usr/include
-- Openssl library: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so
-- Http client: Curl
-- Found CURL: /usr/lib64/libcurl.so (found version "7.61.1")
-- Curl include directory: /usr/include
-- Curl library: /usr/lib64/libcurl.so
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC - Success
CMake Error at CMakeLists.txt:184 (include):
include could not find load file:
AwsFindPackage
CMake Error at CMakeLists.txt:194 (add_subdirectory):
The source directory
/tmp/aws-sdk-cpp-1.9.9/crt/aws-crt-cpp
does not contain a CMakeLists.txt file.
-- Add s3-crt:s3 to C2J_SPECIAL_NAME_LIST
-- Considering s3
-- Looking for pathconf
-- Looking for pathconf - found
-- Looking for umask
-- Looking for umask - found
-- The C compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Updating version info to 1.9.9
-- Custom memory management enabled; stl objects now using custom allocators
-- Performing Test CURL_HAS_H2
-- Performing Test CURL_HAS_H2 - Success
-- Performing Test CURL_HAS_TLS_PROXY
-- Performing Test CURL_HAS_TLS_PROXY - Success
CMake Error at aws-cpp-sdk-core/CMakeLists.txt:496 (aws_use_package):
Unknown CMake command "aws_use_package".
-- Configuring incomplete, errors occurred!
See also "/tmp/aws-sdk-cpp-1.9.9/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/aws-sdk-cpp-1.9.9/build/CMakeFiles/CMakeError.log".
What is the correct solution to build aws-sdk-cpp on an Amazon Linux 2 system ?
Something changed in the past weeks, it worked fine for me before, now I got the same error as you.
Cloning with submodules fixed it for me:
$ git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git
(With version 2.13 of Git and later, --recurse-submodules can be used instead of --recursive)

How to use clang-10 or gcc-10 when building via Github Actions?

I'm writing a library in C++ that implements a few different coroutine primitives, and the library is targeted at the newly released C++20. As a result, it also makes use of things like concepts that were added to the language in C++20.
I want to use github actions to build the library, but builds are failing because ubuntu-latest uses GCC 9 and CLang 9, but my library requires at least GCC 10 or Clang 10 to build.
I attempted to configure the build action by setting -DCMAKE_CXX_COMPILER=g++-10, but the action fails in the Configure CMake phase because g++-10 can't be found on the system.
Is there any way specify github actions should use GCC 10 or Clang 10?
This is the most recent workflow file I tried running:
name: CMake
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=g++-10
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
And this is the point where it fails:
Run cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=g++-10
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_COMPILER:
g++-10
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/home/runner/work/conduit/build/CMakeFiles/CMakeOutput.log".
See also "/home/runner/work/conduit/build/CMakeFiles/CMakeError.log".
##[error]Process completed with exit code 1.
As Some programmer dude mentioned, installing g++ from apt is the way to go (unless it's installed by default); adds a minute or two to the build. Then you can tell cmake which compiler it should use by passing CC and CXX variables during configure step:
- run: |
sudo apt update
sudo apt install gcc-10 g++-10
shell: bash
# ... #
- run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
shell: bash
env:
CC: gcc-10
CXX: g++-10
Same solution applies when you want to use clang.
I am using both gcc-9 and clang-10 for C (only) project.
- name: Setup dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install -y gcc-9 llvm-10 clang-10
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 100 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives \
--install /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-10 100 \
--slave /usr/bin/llvm-ranlib llvm-ranlib /usr/bin/llvm-ranlib-10 \
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-10
sudo update-alternatives \
--install /usr/bin/clang clang /usr/bin/clang-10 100
PS you need to update more alternatives for C++ project, just example.
You can see what's installed by visiting https://github.com/actions/virtual-environments.
If you're trying this in 2022, now ubuntu-latest has "GNU C++ 9.3.0, 10.3.0". g++ is linked to version 9, but g++-10 is available on the PATH without any extra installation steps.

Specifying compiler versions in travis for cmake builds

The travis Building a C++ Project documentation shows how to specify gcc and clang compiler versions in build matrices. However, it does not show how to build projects with those compilers using cmake.
I amended the .travis.yml file here to specify gcc 9 and clang 8 as per the travis documentation, i.e.:
matrix:
include:
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-bionic-8
packages:
- clang-8
- libstdc++-8-dev
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
before_install:
- eval "${MATRIX_EVAL}"
- pip install --user cpp-coveralls
...
script:
- mkdir _builds
- cd _builds
- cmake -DVIA_HTTPLIB_UNIT_TESTS=ON -DVIA_HTTPLIB_COVERAGE=ON ${CMAKE_OPTIONS} ..
- make
- ./via-httplib_test
But is caused build errors when running cmake, e.g.:
$ cmake -DVIA_HTTPLIB_UNIT_TESTS=ON -DVIA_HTTPLIB_COVERAGE=ON ${CMAKE_OPTIONS} ..
CMake Error at /usr/local/cmake-3.12.4/share/cmake-3.12/Modules/CMakeDetermineCCompiler.cmake:48 (message):
Could not find compiler set in environment variable CC:
gcc-9.
Call Stack (most recent call first):
CMakeLists.txt:9 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/travis/build/kenba/via-httplib/_builds/CMakeFiles/CMakeOutput.log".
The command "cmake -DVIA_HTTPLIB_UNIT_TESTS=ON -DVIA_HTTPLIB_COVERAGE=ON ${CMAKE_OPTIONS} .." exited with 1.
I tried fixing the errors by specifying CMAKE_C_COMPILER and CMAKE_CXX_COMPILER for cmake, but I could not get it to work.
However, it builds correctly with:
env:
- MATRIX_EVAL="CC=gcc && CXX=g++"
...
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
but builds with the default bionic gcc and clang compilers, i.e.: GCC 7.4.0 and Clang 7, not GCC 9 and Clang 8.
How to write a .travis.yml file so that cmake can find and use
the compiler versions specified in a matrix?
Perhaps it was a Travis issue? Simply adding the g++-9 package and changing the variable to MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" results in a successful compilation of your project with GCC 9.3.0
This is a minimal example that I use for building my project:
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- clang-8
env:
- MATRIX_EVAL="CC=clang-8 CXX=clang++-8"
- os: linux
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- g++-9
env:
- MATRIX_EVAL="CC=gcc-9 CXX=g++-9"
before_install:
- eval "${MATRIX_EVAL}"
script:
- cmake .
- make

mongo-cxx-driver installation does install libraries

I am trying to compile mongo-cxx-driver-r3.1.1 on Ubuntu14.4 . I have installed mongo-c-driver-1.6.3 from source as per instructions.
pkg-config --cflags --libs libmongoc-1.0 libbson-1.0 returns
-I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -L/usr/local/lib -lmongoc-1.0 -lsasl2 -lssl -lcrypto -lrt -lbson-1.0
I have boost version 1.57. When I try to compile mongo-cxx-driver-r3.1.1 as per the instructions provided in https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/ using cmake.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
I get the following logs :
-- Boost version: 1.57.0
-- Configuring done
-- Generating done
-- Build files have been written to: /user/home/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build
I have tried other options such as:
cmake -DBSONCXX_POLY_USE_MNMLSTC:Bool=OFF -DBSONCXX_POLY_USE_BOOST:Bool=ON -
DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_COMPILER="/usr/bin/gcc" -
DCMAKE_CXX_COMPILER="/usr/bin/g++-4.8" -DCMAKE_BUILD_TYPE=Release -
DCMAKE_INSTALL_PREFIX=/usr/local -DLIBMONGOC_DIR=/usr/local/lib -
DLIBBSON_DIR=/usr/local/lib ..
However, I dont see the mongocxx related libraries or header files. Following is the CMakeFiles/CMakeOutput.log output:
The system is: Linux - 3.13.0-32-generic - x86_64 Compiling the CXX
compiler identification source file "CMakeCXXCompilerId.cpp"
succeeded. Compiler: /usr/bin/g++-4.8 Build flags: Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out"
Determining if the CXX compiler works passed with the following output:
Change Dir: /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec1480695504/fast"
ake[1]: Entering directory /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o
/usr/bin/g++-4.8 -o CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o -c /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec1480695504
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1480695504.dir/link.txt --verbose=1
/usr/bin/g++-4.8 CMakeFiles/cmTryCompileExec1480695504.dir/testCXXCompiler.cxx.o -o cmTryCompileExec1480695504 -rdynamic
make[1]: Leaving directory/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec4079379117/fast"
.............
...................
/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:2:25: warning: \u2018int somefunc()\u2019 is deprecated (declared at /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:1) [-Wdeprecated-declarations]
int main() { return somefunc();}
^
/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:2:34: warning: \u2018int somefunc()\u2019 is deprecated (declared at /home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp/src.cxx:1) [-Wdeprecated-declarations]
int main() { return somefunc();}
^
Linking CXX executable cmTryCompileExec1892014975
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1892014975.dir/link.txt --verbose=1
/usr/bin/g++-4.8 -DCOMPILER_HAS_DEPRECATED_ATTR CMakeFiles/cmTryCompileExec1892014975.dir/src.cxx.o -o cmTryCompileExec1892014975 -rdynamic
make[1]: Leaving directory `/home/cvaidyan/mongo-c-driver-1.6.3/mongo-cxx-driver-r3.1.1/build/CMakeFiles/CMakeTmp'
Source file was:
attribute((deprecated)) int somefunc() { return 0; }
int main() { return somefunc();}
I could post the entire cmake output if it is meaningful. I grep'ed for "error" or "fail" in the file , but wasn't able to find either strings.
It would be great if someone could point out, what I am missing here?
this bash file works well for ubuntu 16.04
#!/bin/bash
apt-get update >> /dev/null
apt-get install openssh-server -y
apt-get install g++ -y
apt-get install cmake -y
apt-get install git -y
#installing the mongoc dependencies and driver
apt-get install pkg-config libssl-dev libsasl2-dev -y
cd ~
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.6.2/mongo-c-driver-1.6.2.tar.gz
tar xzf mongo-c-driver-1.6.2.tar.gz
cd mongo-c-driver-1.6.2
./configure --disable-automatic-init-and-cleanup
make
make install
cd ~
rm mongo-c-driver-1.6.2.tar.gz
rm -rf mongo-c-driver-1.6.2
#installing mongocxx driver - connects c++ to mongo
wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.1.1.tar.gz
tar -xzf r3.1.1.tar.gz
cd mongo-cxx-driver-r3.1.1/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
make EP_mnmlstc_core
make
make install
cd ~
rm r3.1.1.tar.gz
rm -rf mongo-cxx-driver-r3.1.1

Change C++ compiler for cmake under TravisCI

As far I know the best way to change the target C++ compiler used by cmake is to change the CXX environment variable just before the call to cmake:
$ export CXX="clang++" && cmake --build
The Travis CI build sets the CXX and CC accordingly to the settings of the build. So if you have this in your .travis.yml:
language: cpp
compiler:
- gcc
- clang
script:
- cmake --build
- ./bin/foo
The first time cmake should use GCC and Clang on the latter isn't?
Instead, the GCC build compiles just fine (Its the default compiler used by cmake), but the Clang version uses GCC too:
0.01s$ echo $CC $CXX
clang clang++
The command "echo $CC $CXX" exited with 0.
0.02s$ $CXX --version
clang version 3.4 (tags/RELEASE_34/final) Target: x86_64-unknown-linux-gnu Thread model: posix
Running: cmake -G "Unix Makefiles" -Wno-dev ../cmake
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
I even tried to set those variables again just before the call:
- if [ "$CXX" == "clang++" ]; then export CXX="clang++" && cmake --build; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++" && cmake --build; fi
Which has no much sense I think...
Here is the successful build using GCC, and here the (Supposed to be) clang build.
My question is: How I can change the compiler used by cmake under Travis CI?
Here is my .travis.yml.
Explanation
In your .travis.yml we see:
- if [ "$CXX" == "clang++" ]; then export CXX="clang++" && bii cpp:build; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++" && bii cpp:build; fi
biicode's command bii cpp:build runs CMake with biicode's default generator which is "Unix Makefiles" for UNIX platform (GNU toolchain). Read about it: Biicode C++ documentation - Generators and IDEs.
This behaviour is seen in your logs: Running: cmake -G "Unix Makefiles" -Wno-dev ../cmake (https://travis-ci.org/Manu343726/Turbo/jobs/33889114, line 257)
CMake not always looks for environment variables CXX/CC (as stated in CMake FAQ). It depends on selected generator. It works for me when I call CMake with no generator (my travis file: https://github.com/quepas/Graph-ene/blob/master/.travis.yml).
Solutions
Use CMake alone with cmake -D format described in method 2 (CMake FAQ - How do I use a different compiler?)
Setup biicode to use proper CMake's generator (Biicode C++ Configuration) or use biicode's custom toolchain (Biicode - Using custom toolchain)
You can use a matrix. This is especially useful if you have many different compilers (eg. gcc5, gcc6, clang3.7, clang3.8):
language: generic # Works better in most cases
matrix:
include:
- env: CXX=g++ CC=gcc
# additional apt settings if needed
- env: CXX=clang++ CC=clang
script:
- ...
If you have different versions of a compiler this can be extended:
[…]
matrix:
include:
- env: CXX=g++-5 CC=gcc-5
- env: CXX=g++-6 CC=gcc-6
- env: CXX=clang++-3.8 CC=clang-3.8
[…]
It also doesn't duplicate the script steps and keeps the file clean of if… else… parts.
https://travis-ci.org/RhysU/descendu/builds/158055261