SDKROOT path for latest SDK

后端 未结 4 892
悲&欢浪女
悲&欢浪女 2021-02-01 18:58

I am using Xcode to build an old code and specify SDKROOT=/Developer/SDKs/MacOSX\"${HOST_VERSION}\".sdk/

I want to specify SDKROOT for latest SDK that comes

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 19:09

    Newer Xcode versions have the SDKs inside the Xcode.app bundle, e.g.

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
    

    You get the list of installed SDKs together with their path by running

    xcodebuild -sdk -version
    

    from the command line.

    If you have installed the "Command Line Tools" (Xcode Preferences -> Downloads -> Components) then compiling without "-syslibroot" should be equivalent to compiling against the latest SDK.

    See the help to the "Command Line Tools" package:

    Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.

提交回复
热议问题