From 2592b937706a4393ad2f275da32ae9dab48e594d Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 9 Mar 2020 22:40:02 +0000 Subject: [PATCH] formula: ensure CMake uses the desired SDK --- Library/Homebrew/formula.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ad8057a358..48abb74447 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1335,6 +1335,10 @@ class Formula # CMake cache entries for other weak symbols may be added here as needed. args << "-DHAVE_CLOCK_GETTIME:INTERNAL=0" if MacOS.version == "10.11" && MacOS::Xcode.version >= "8.0" + # Ensure CMake is using the same SDK we are using. + sdk = MacOS.sdk_path_if_needed + args << "-DCMAKE_OSX_SYSROOT=#{sdk}" if sdk + args end