From 23612165e7dc03c758f95cdea4147ea3ea05e6cd Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Tue, 1 Mar 2022 02:32:39 +0900 Subject: [PATCH] _scripts: handle not installed CommandLineTools (#2914) Signed-off-by: Koichi Shiraishi --- _scripts/make.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_scripts/make.go b/_scripts/make.go index 9bc13311..4e510ec9 100644 --- a/_scripts/make.go +++ b/_scripts/make.go @@ -271,7 +271,8 @@ func canMacnative() bool { typesHeader := "/usr/include/sys/types.h" if major >= 11 || (major == 10 && minor >= 15) { - typesHeader = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h" + sdkpath := strings.TrimSpace(getoutput("xcrun", "--sdk", "macosx", "--show-sdk-path")) + typesHeader = filepath.Join(sdkpath, "usr", "include", "sys", "types.h") } _, err = os.Stat(typesHeader) if err != nil {