| // Copyright 2019 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // The clanghost binary is like clangwrap.sh but for self-hosted iOS. |
| // Use -ldflags="-X main.sdkpath=<path to iPhoneOS.sdk>" when building |
| fmt.Fprintf(os.Stderr, "no SDK is set; use -ldflags=\"-X main.sdkpath=<sdk path>\" when building this wrapper.\n") |
| cmd := exec.Command("clang", "-isysroot", sdkpath, "-mios-version-min=12.0") |
| cmd.Args = append(cmd.Args, args...) |
| if err := cmd.Run(); err != nil { |
| if err, ok := err.(*exec.ExitError); ok { |