----- Original Message -----
> On 07/11/2013 10:41 AM, clin...@elemtech.com wrote:
> > They also appear similar to me, so I would start with the
> > assumption that they should be unified.
> 
> I just dug into this a bit.
> 
> One difference is that CMAKE_OSX_SYSROOT can be set to a logical
> SDK name rather than a path.  In Darwin.cmake there is code to
> transform it to a path by running
> 
>  xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
> 
> If we unify the two we will need to find a way to handle this.
> 
> The value of CMAKE_OSX_SYSROOT is not used in any CMake modules
> outside of Darwin.cmake (and an old reference in Darwin-icc.cmake
> that should probably be refactored anyway).  It is used in only
> three C++ sources:
> 
> * cmCoreTryCompile.cxx: The value of CMAKE_OSX_SYSROOT is passed
>   into the build of the test project for a try-compile.  This
>   will probably be needed for CMAKE_SYSROOT too.
> 
> * cmGlobalXCodeGenerator.cxx: The value of CMAKE_OSX_SYSROOT is
>   used to set the generated Xcode SDKROOT attribute.  The SDKROOT
>   can be a logical name or a path but IIUC the logical name is
>   preferred.  Xcode uses it to add the -isysroot flag.
> 
> * cmLocalGenerator.cxx: The value of CMAKE_OSX_SYSROOT is used
>   to add the -isysroot flags for generators besides Xcode (since
>   Xcode uses the SDKROOT attribute).
> 
> It looks to me like CMAKE_SYSROOT and CMAKE_OSX_SYSROOT are
> pretty much identical other than the logical name mapping.
> At a minimum we need to make them mutually exclusive (at most
> one can be set in a single build tree).  Ideally we should
> combine them so that one only needs to set CMAKE_SYSROOT on
> any platform.
> 
> Combining them is safe only if we're sure CMAKE_SYSROOT will
> not be used for anything besides the toolchain system SDK.
> 

I'm seeing slight hints that we should not merge them.

$ xcrun --help
  ...
  --sdk <sdk name>     find the tool for the given SDK name
  --toolchain <name>   find the tool for the given toolchain
  ...

I currently have SDKs are under 
/Applications/Xcode.app/Contents/Developer/Platform
 - 10.7, 10.8, iPhoneOS6.1, iPhoneSimulator6.1

and toolchains found under /Applications/Xcode.app/Contents/Developer/Toolchains
 - XcodeDefault.xctoolchain (clang)

There's also the llvm/gcc in another place: /usr/llvm-gcc-4.2.

I'm also seeing some C/C++ includes under both the toolchain and SDK trees.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/4.2/include/stdint.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/stdint.h

The toolchain version of stdint.h includes the use of __STDC_HOSTED__, if that 
means anything here.
http://tigcc.ticalc.org/doc/cpp.html#SEC15_STDC_HOSTED

What do you think Brad?  Does it hint towards not merging them?

Clint
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to