aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-11-10 18:24:49 -0600
committerJack Nagel2013-11-10 18:24:49 -0600
commit1f9ee272997dd25d70adaeefaa4e001ce52757e6 (patch)
treea1ba8c0a7efbbbd3868d5d9453dd1a86e0383e30 /Library
parenteb32df9da1e5dbab00d27e146edc86cbb224fa99 (diff)
downloadhomebrew-1f9ee272997dd25d70adaeefaa4e001ce52757e6.tar.bz2
Extract cxxflags method from cflags method
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index a67ba17eb..d4410fa68 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -91,10 +91,14 @@ class Cmd
args << "-syslibroot" << $sdkroot
end if nclt?
allflags = case mode
- when :ccld, :cxxld
+ when :ccld
cflags + args + cppflags + ldflags
- when :cc, :cxx
+ when :cxxld
+ cxxflags + args + cppflags + ldflags
+ when :cc
cflags + args + cppflags
+ when :cxx
+ cxxflags + args + cppflags
when :ccE
args + cppflags
when :cpp
@@ -158,11 +162,6 @@ class Cmd
end
def cflags
args = []
- if mode == :cxx
- args << '-std=c++11' if cccfg? 'x'
- args << '-stdlib=libc++' if cccfg? 'g'
- args << '-stdlib=libstdc++' if cccfg? 'h'
- end
return args unless cccfg? 'O'
@@ -188,6 +187,13 @@ class Cmd
args << "-std=#{@arg0}" if @arg0 =~ /c[89]9/
args
end
+ def cxxflags
+ args = cflags
+ args << '-std=c++11' if cccfg? 'x'
+ args << '-stdlib=libc++' if cccfg? 'g'
+ args << '-stdlib=libstdc++' if cccfg? 'h'
+ args
+ end
def syslibpath
# We reject brew's lib as we explicitly add this as a -L flag, thus it
# is given higher priority by cc, so it surpasses the system libpath.