That depends on your build system. Most build systems in Linux accept the standard way, setting CC
and CXX
envvars.
In the case of LLVM 7, that’ll be:
addons:
apt:
packages:
- clang-7
env:
# may need to be under 'global:' or 'matrix:' if 'env:' is on top level,
# see https://docs.travis-ci.com/user/environment-variables/
# Or just 'export' them in the script
- CC=clang-7
CXX=clang++-7
Though the specific error you gave looks like a problem with your code at first glance: earlier in the log, there’s a warning referencing a #define that suggests that the name of the “module” that’s not found is something that you yourself pass.