From ffc4c31b824856f421a13e4e93e25e55f40921e4 Mon Sep 17 00:00:00 2001 From: David Hows Date: Tue, 17 Oct 2017 19:40:09 +1100 Subject: [PATCH] Add a new +clanglibcpp option for Boost (#5708) * Add a new +clanglibcpp option for Boost Currently, the compile of boost with clang will use the stdlibc++. This patch adds an optional flag to use clangs included libc++ instead. * Linting Fix long lines and white space errors --- var/spack/repos/builtin/packages/boost/package.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index c46c68a47b6..766298c940e 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -135,6 +135,8 @@ class Boost(Package): description="Augment library names with build options") variant('versionedlayout', default=False, description="Augment library layout with versioned subdirs") + variant('clanglibcpp', default=False, + description='Compile with clang libc++ instead of libstdc++') depends_on('icu4c', when='+icu') depends_on('python', when='+python') @@ -290,6 +292,10 @@ def determine_b2_options(self, spec, options): # https://svn.boost.org/trac/boost/ticket/12496 if spec.satisfies('%clang'): options.extend(['pch=off']) + if '+clanglibcpp' in spec: + options.extend(['toolset=clang', + 'cxxflags="-stdlib=libc++"', + 'linkflags="-stdlib=libc++"']) return threadingOpts