Merge pull request #3593 from harold-b/fix-build-sysroot-macos

Attempt to automatically resolve the sysroot on build_odin.sh on macOS
This commit is contained in:
gingerBill
2024-05-19 23:59:44 +01:00
committed by GitHub
+10 -1
View File
@@ -64,7 +64,16 @@ Darwin)
fi
fi
CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)"
darwin_sysroot=
if [ $(which xcode-select) ]; then
darwin_sysroot="--sysroot $(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
elif [[ -e "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" ]]; then
darwin_sysroot="--sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
else
echo "Warning: MacOSX.sdk not found."
fi
CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags) ${darwin_sysroot}"
LDFLAGS="$LDFLAGS -liconv -ldl -framework System -lLLVM"
;;
FreeBSD)