From 9816cd4f17637be8e9aff43be7ad51587ea5e34d Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Mon, 20 Jul 2020 10:36:47 -0700 Subject: [PATCH] mas: fix build on Apple Silicon Its dependency will build for x86_64 unless explicitly asked to build for another CPU. --- Formula/mas.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Formula/mas.rb b/Formula/mas.rb index 2da2667ad0289..2d5840e6cb6c5 100644 --- a/Formula/mas.rb +++ b/Formula/mas.rb @@ -20,10 +20,13 @@ def install # Working around build issues in dependencies # - Prevent warnings from causing build failures # - Prevent linker errors by telling all lib builds to use max size install names + # - Ensure dependencies build for the current CPU; otherwise Commandant will + # build for x86_64 when running arm64 xcconfig = buildpath/"Overrides.xcconfig" xcconfig.write <<~EOS GCC_TREAT_WARNINGS_AS_ERRORS = NO OTHER_LDFLAGS = -headerpad_max_install_names + VALID_ARCHS = #{Hardware::CPU.arch} EOS ENV["XCODE_XCCONFIG_FILE"] = xcconfig