Skip to content

Commit

Permalink
soci: refactor install.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Mar 6, 2018
1 parent 457956a commit c1f7cf5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Formula/soci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ class Soci < Formula
depends_on "boost" => [:build, :optional]
depends_on "sqlite" if MacOS.version <= :snow_leopard

def translate(a)
(a == "pg") ? "postgresql" : a
end

fails_with :clang do
build 421
cause "Template oddities"
Expand All @@ -33,9 +29,10 @@ def translate(a)
def install
args = std_cmake_args + %w[.. -DWITH_SQLITE3:BOOL=ON]

%w[boost mysql oracle odbc pg].each do |a|
bool = build.with?(a) ? "ON" : "OFF"
args << "-DWITH_#{translate(a).upcase}:BOOL=#{bool}"
%w[boost mysql oracle odbc pg].each do |arg|
arg_var = (arg == "pg") ? "postgresql" : arg
bool = build.with?(arg) ? "ON" : "OFF"
args << "-DWITH_#{arg_var.upcase}:BOOL=#{bool}"
end

mkdir "build" do
Expand Down

0 comments on commit c1f7cf5

Please sign in to comment.