Skip to content
Snippets Groups Projects
Unverified Commit 67ea581e authored by Maxim Belkin's avatar Maxim Belkin
Browse files

extend/ENV/shared.rb: [new method] append_to_cccfg

append_to_cccfg properly appends values to HOMEBREW_CCCFG variable
parent bb82f059
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,10 @@ module SharedEnvExtension
remove CC_FLAG_VARS, val
end
def append_to_cccfg(value)
append(HOMEBREW_CCCFG, value, "")
end
def append(keys, value, separator = " ")
value = value.to_s
Array(keys).each do |key|
......
......@@ -285,7 +285,7 @@ module Superenv
end
def permit_arch_flags
append "HOMEBREW_CCCFG", "K", ""
append_to_cccfg "K"
end
def m32
......@@ -298,26 +298,26 @@ module Superenv
def cxx11
if homebrew_cc == "clang"
append "HOMEBREW_CCCFG", "x", ""
append "HOMEBREW_CCCFG", "g", ""
append_to_cccfg "x"
append_to_cccfg "g"
elsif compiler_with_cxx11_support?(homebrew_cc)
append "HOMEBREW_CCCFG", "x", ""
append_to_cccfg "x"
else
raise "The selected compiler doesn't support C++11: #{homebrew_cc}"
end
end
def libcxx
append "HOMEBREW_CCCFG", "g", "" if compiler == :clang
append_to_cccfg "g" if compiler == :clang
end
def libstdcxx
append "HOMEBREW_CCCFG", "h", "" if compiler == :clang
append_to_cccfg "h" if compiler == :clang
end
# @private
def refurbish_args
append "HOMEBREW_CCCFG", "O", ""
append_to_cccfg "O"
end
%w[O3 O2 O1 O0 Os].each do |opt|
......
......@@ -139,6 +139,6 @@ module Superenv
end
def no_weak_imports
append "HOMEBREW_CCCFG", "w", "" if no_weak_imports_support?
append_to_cccfg "w" if no_weak_imports_support?
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment