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