From 2cd5199d70c0f7c7309415596b2c04bcbfe41e0b Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Mon, 21 Apr 2014 01:23:58 -0600 Subject: Support --c++11 for libmongoclient This commit adds support for building libmongoclient in C++11 mode. It also changes boost from a build dependency to a normal dependency in both C++98 and C++11 mode. Since the library can't be linked into a program or used without several of the boost libraries, it didn't seem reasonable to only declare boost as a build dependency. Closes #29003. [jn: style fixes] Signed-off-by: Kevin Locke Signed-off-by: Jack Nagel --- Library/Formula/libmongoclient.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Library') diff --git a/Library/Formula/libmongoclient.rb b/Library/Formula/libmongoclient.rb index 1e59bc9d7..0f96cd38b 100644 --- a/Library/Formula/libmongoclient.rb +++ b/Library/Formula/libmongoclient.rb @@ -7,10 +7,19 @@ class Libmongoclient < Formula head 'https://github.com/mongodb/mongo-cxx-driver.git', :branch => "26compat" + option :cxx11 + depends_on 'scons' => :build - depends_on 'boost' => :build + + if build.cxx11? + depends_on 'boost' => 'c++11' + else + depends_on 'boost' + end def install + ENV.cxx11 if build.cxx11? + boost = Formula["boost"].opt_prefix args = [ @@ -21,13 +30,14 @@ class Libmongoclient < Formula "--extrapath=#{boost}", "--full", "--use-system-all", - "--sharedclient" + "--sharedclient", + # --osx-version-min is required to override --osx-version-min=10.6 added + # by SConstruct which causes "invalid deployment target for -stdlib=libc++" + # when using libc++ + "--osx-version-min=#{MacOS.version}", ] - if MacOS.version >= :mavericks - args << "--osx-version-min=10.8" - args << "--libc++" - end + args << "--libc++" if MacOS.version >= :mavericks scons *args end -- cgit v1.2.3