diff options
| author | Kevin Locke | 2014-04-21 01:23:58 -0600 |
|---|---|---|
| committer | Jack Nagel | 2014-05-16 11:26:14 -0500 |
| commit | 2cd5199d70c0f7c7309415596b2c04bcbfe41e0b (patch) | |
| tree | 4c2a0644c3b816d34c79ab73338f01026a80ca71 /Library | |
| parent | b629390ce5940a9c1e2c6e7ca7227b523767e358 (diff) | |
| download | homebrew-2cd5199d70c0f7c7309415596b2c04bcbfe41e0b.tar.bz2 | |
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 <kevin@kevinlocke.name>
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/libmongoclient.rb | 22 |
1 files changed, 16 insertions, 6 deletions
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 |
