[cmake-developers] Test fails with Xcode

Brad King brad.king at kitware.com
Wed Jun 26 13:21:18 EDT 2013


On 6/26/2013 12:31 PM, Stephen Kelly wrote:
> It calls the virtual cmLocalGenerator::AppendFlags, and 
> cmLocalUnixMakefileGenerator3::AppendFlags does appropriate escaping, but 
> the former does not. 

No, cmLocalUnixMakefileGenerator3::AppendFlags does no escaping
except to fix up special cases on Watcom Make to make it work
like other make tools.

> I think the problem is that there is no cmLocalXCodeGenerator::AppendFlags 
> override. Given commit 35496761a58956bd8c5ad65a3ed9ee78d09af56b, I think a 
> similar problem should appear if a similar -DFOO="Bar" is put into the 
> COMPILE_FLAGS target property. That would confirm that this problem pre-
> dates the COMPILE_OPTIONS property. Can you test that?

Ahh.  COMPILE_FLAGS has *never* been escaped on *any* generator.
It is just a raw string to be added to command lines.  This is
historical and will not be changed, which is one reason we need
a new feature like COMPILE_OPTIONS.

Part of the value of COMPILE_OPTIONS is supposed to be that it
takes a ;-list of options and escapes each one appropriately.
You'll have to go back and fix up the generators or cmTarget's
GetCompileOptions method to use lg->EscapeForShell when appending
each flag.

-Brad



More information about the cmake-developers mailing list