aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisty De Meo2013-10-06 17:00:30 -0700
committerMisty De Meo2013-10-06 19:26:06 -0700
commit4ed26b20f4f508c4d5254f452bcaeadb32bf3ede (patch)
tree5703a3730b227179fb91c4f6be8c99b46f9dff16
parent77b678cea95b762cbeda3f2d69b93c43a3848a15 (diff)
downloadhomebrew-4ed26b20f4f508c4d5254f452bcaeadb32bf3ede.tar.bz2
Track the OS's default C++ stdlib
-rwxr-xr-xLibrary/Homebrew/build.rb7
-rw-r--r--Library/Homebrew/macos.rb4
2 files changed, 9 insertions, 2 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 6cb903efd..d9f4fa43b 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -141,12 +141,15 @@ class Build
end
end
- # We only support libstdc++ right now
- stdlib_in_use = CxxStdlib.new(:libstdcxx, ENV.compiler)
+ # TODO Track user-selected stdlibs, such as boost in C++11 mode
+ stdlib = ENV.compiler == :clang ? MacOS.default_cxx_stdib : :libstdcxx
+ stdlib_in_use = CxxStdlib.new(stdlib, ENV.compiler)
# This is a bad place for this check, but we don't have access to
# compiler selection within the formula installer, only inside the
# build instance.
+ # This is also awkward because we don't actually know yet if this package
+ # will link against a C++ stdlib, but we don't want to test after the build.
stdlib_in_use.check_dependencies(f, deps)
f.brew do
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index 19cbbe421..b3e4b6452 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -110,6 +110,10 @@ module MacOS extend self
end
end
+ def default_cxx_stdlib
+ version >= :mavericks ? :libcxx : :libstdcxx
+ end
+
def gcc_40_build_version
@gcc_40_build_version ||=
if (path = locate("gcc-4.0"))