36 lines · plain
1import("//llvm/utils/gn/build/sysroot.gni")2 3have_ios_sdks = true4 5declare_args() {6 mac_deployment_target = "12"7}8 9if (sysroot == "") {10 declare_args() {11 # Set to true if you don't have Xcode installed, but do have the commandline12 # tools.13 mac_use_commandline_tools_sdk = false14 }15 16 # Location of the mac sdk.17 # The correct way to do this is to call xcrun18 # (https://reviews.llvm.org/D70835), but that makes `gn gen` take twice as19 # long and almost everyone has Xcode installed. So require that people who20 # don't have it installed set a gn arg.21 if (mac_use_commandline_tools_sdk) {22 mac_sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"23 24 # iOS SDKs aren't available in the commandline tools SDK.25 have_ios_sdks = false26 } else {27 mac_sdk_path = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"28 ios_sdk_path = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"29 iossim_sdk_path = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"30 }31} else {32 ios_sdk_path = sysroot + "/iPhoneOS.sdk"33 iossim_sdk_path = sysroot + "/iPhoneSimulator.sdk"34 mac_sdk_path = sysroot + "/MacOSX.sdk"35}36