SCons support for LLVM clang C++ compiler.
SCons currently provides clangxx
tool which replaces this one. See SCons
user documentation, especially the tool list. This package is left here for
historical reasons and for some experimental purposes.
There are few ways to install this tool to your project.
From pypi
pip install scons-tool-loader scons-tool-clangpp
or, if your project uses pipenv:
pipenv install --dev scons-tool-loader scons-tool-clangpp
Alternatively, you may add this to your Pipfile
[dev-packages] scons-tool-loader = "*" scons-tool-clangpp = "*"
The tool will be installed as a namespaced package sconstool.clangpp
in project's virtual environment. You may further use scons-tool-loader
to load the tool.
Create new git repository:
mkdir /tmp/prj && cd /tmp/prj touch README.rst git init
Add the scons-tool-clangpp as a submodule:
git submodule add git://github.com/ptomulik/scons-tool-clangpp.git site_scons/site_tools/clangpp
Create simple C++ file
// test.cpp int main() { return 0; }
Create simple SConstruct file
# SConstruct # TODO: uncomment following lines if the tool is installed via pip/pipenv # import sconstool.loader # sconstool.loader.extend_toolpath(transparent=True) env = Environment(tools = ['default', 'clangpp']) print(env.subst("using $CXX $CXXVERSION")) env.Program('test.cpp')
Try it out:
scons
Copyright (c) 2014-2020 by Paweł Tomulik <ptomulik@meil.pw.edu.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE