Skip to content
This repository was archived by the owner on Nov 27, 2017. It is now read-only.
This repository was archived by the owner on Nov 27, 2017. It is now read-only.

ENV.cxx detecting system g++ not Brew g++ #1035

@tseemann

Description

@tseemann

I was just writing a new formula today for the SDSL-Lite library and am having strange issues with the test block where I compile a small .cpp file for library. It's C++11.

% which g++
/bio/linuxbrew/bin/g++

% g++ --version
g++ (Homebrew gcc 5.3.0) 5.3.0

> puts ENV.cc # in test block
/usr/bin/gcc

> puts ENV.cxx # in test block
/usr/bin/g++

> ENV.cxx11
The selected compiler doesn't support C++11: gcc
/bio/linuxbrew/Library/Homebrew/extend/ENV/std.rb:318:in `cxx11'

This is the code, which assumes that g++ has it's version suffixed on it?

  def cxx11
    if compiler == :clang
      append "CXX", "-std=c++11"
      append "CXX", "-stdlib=libc++"
    elsif compiler =~ /gcc-(4\.(8|9)|5)/
      append "CXX", "-std=c++11"
    else
      raise "The selected compiler doesn't support C++11: #{compiler}"
    end
  end

Recent commit involving this file:
https://github.com/Linuxbrew/linuxbrew/commits/e2f0212222c747eb84d6585097c46f7f5ddfd7be/Library/Homebrew/extend/ENV/std.rb

commit e2f0212222c747eb84d6585097c46f7f5ddfd7be
Merge: 59fc90c 5991466
Author: Shaun Jackman <sjackman@gmail.com>
Date:   Wed Mar 23 11:30:52 2016 -0700

    Merge branch homebrew/master into linuxbrew/master

    Conflicts:
        Library/Homebrew/extend/ENV/std.rb

Maybe something to do with new HOMEBREW_ENV_PATH ?
Or #1033 ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions