Skip to content

cxxflags not propagated to all compilation commands #14

@mloskot

Description

@mloskot

Configuration

Using the fabscripts in the current Boost.GIL develop:

Problem

Since GIL requires C++11, but fabscripts do not specify the required language version, I follow the example

# * `faber cxxflags=-std=c++14`

running faber cxxflags=-std=c++11:

$ faber cxxflags=-std=c++11 test.pixel
gxx.makedep test.pixel.d
In file included from /usr/include/c++/5/cstdint:35:0,
                 from include/boost/gil/channel.hpp:19,
                 from include/boost/gil/pixel.hpp:11,
                 from include/boost/gil/bit_aligned_pixel_reference.hpp:11,
                 from include/boost/gil/bit_aligned_pixel_iterator.hpp:11,
                 from include/boost/gil/algorithm.hpp:11,
                 from include/boost/gil.hpp:12,
                 from ./test/pixel.cpp:8:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
In file included from include/boost/gil/pixel.hpp:12:0,
                 from include/boost/gil/bit_aligned_pixel_reference.hpp:11,
                 from include/boost/gil/bit_aligned_pixel_iterator.hpp:11,
                 from include/boost/gil/algorithm.hpp:11,
                 from include/boost/gil.hpp:12,
                 from ./test/pixel.cpp:8:
include/boost/gil/color_base.hpp:62:21: error: missing binary operator before token "("
 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
                     ^
include/boost/gil/color_base.hpp:326:21: error: missing binary operator before token "("
 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
                     ^
In file included from include/boost/gil.hpp:24:0,
                 from ./test/pixel.cpp:8:
include/boost/gil/planar_pixel_reference.hpp:77:21: error: missing binary operator before token "("
 #if BOOST_WORKAROUND(__HP_aCC, >= 61700) || BOOST_WORKAROUND(__INTEL_COMPILER, >= 1000)
                     ^
gxx.makedep test.error_if.d
...skipped test/g++-5.5.0/x86_64/pixel.o for lack of test/g++-5.5.0/x86_64/pixel.d...
gxx.compile test.error_if.o
...skipped test/g++-5.5.0/x86_64/pixel for lack of test/g++-5.5.0/x86_64/pixel.o...
...skipped test.pixel for lack of test/g++-5.5.0/x86_64/pixel...
test.pixel: FAIL
...failed updating 1 artefact...
...updated 2 artefacts...

The commands logging

$ faber --log=commands cxxflags=-std=c++11 test.pixel
g++ -DBOOST_ALL_NO_LIB -Iinclude -MM -o test/g++-5.5.0/x86_64/pixel.d ./test/pixel.cpp
g++ -DBOOST_ALL_NO_LIB -Iinclude -std=c++11 -m64 -c -o test/g++-5.5.0/x86_64/error_if.o ./test/error_if.cpp

suggest, -std=c++11 is missing from the command line compiling pixel.cpp.

Questions

  • Where C++11 requirement should be specified? Top-level fabscript like this features += include('-std=c++11')?
  • Why tutorial/advanced_concepts.rst and reference/tool.rst use double dash in features=cxxflags('--std=c++11') and other examples? Is it Faber thing or a typo and it should read -std=c++11?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions