[cmake-developers] adding --sysroot

Stephen Kelly steveire at gmail.com
Wed Apr 24 09:46:24 EDT 2013


Brad King wrote:

> On 04/24/2013 08:38 AM, Stephen Kelly wrote:
>> I pushed a set-sysroot branch implementing this to my clone. This
>> actually also makes it possible to cross-compile for android without
>> forcing the compiler.
> 
> That looks like a good start.  The "--sysroot" flag should be looked
> up through a platform information variable set in Modules/Platform/*
> or Modules/Compiler/*.

That seems like a good idea. It would ensure that we don't erroneously add 
the flag to compilers that don't support it. 

I initially added it to Modules/Platform/GNU.cmake, but that failed during 
the testing the c++ compiler stage (for android) because the 
CMAKE_SYSROOT_FLAG was apparently not defined yet then, so I've added it to 
Modules/Compiler/GNU.cmake instead. 

I assume that is also read by clang, so I'll try to test the flag with that 
too if I can figure out how to cross compile with clang. I assume it is used 
by icc too, but I can't test that.

Thanks,

Steve.





More information about the cmake-developers mailing list