Skip to content

Commit

Permalink
ENV: don't set MACOSX_DEPLOYMENT_TARGET
Browse files Browse the repository at this point in the history
CMake tries to use Xcode if MACOSX_DEPLOYMENT_TARGET is set but that can
lead to build failures when SDKROOT isn't set. The CMake behavior at
minimum manifests as -isysroot spontaneously being set to the Xcode SDK,
which brew sometimes can't successfully fully unwind with its ENV hacks.
  • Loading branch information
ilovezfs committed Nov 18, 2017
1 parent dbc04b4 commit 15a2ef5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Library/Homebrew/extend/os/mac/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def remove_macosxsdk(version = MacOS.version)
# previously added by macosxsdk
version = version.to_s
remove_from_cflags(/ ?-mmacosx-version-min=10\.\d+/)
delete("MACOSX_DEPLOYMENT_TARGET")
delete("CPATH")
remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"

Expand All @@ -83,7 +82,6 @@ def macosxsdk(version = MacOS.version)
remove_macosxsdk
version = version.to_s
append_to_cflags("-mmacosx-version-min=#{version}")
self["MACOSX_DEPLOYMENT_TARGET"] = version
self["CPATH"] = "#{HOMEBREW_PREFIX}/include"
prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/extend/os/mac/extend/ENV/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ def determine_cccfg
def setup_build_environment(formula = nil)
generic_setup_build_environment(formula)
self["HOMEBREW_SDKROOT"] = effective_sysroot

self["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s
self["SDKROOT"] = MacOS.sdk_path if MacOS::Xcode.without_clt?

# Filter out symbols known not to be defined since GNU Autotools can't
Expand Down

0 comments on commit 15a2ef5

Please sign in to comment.