[CMake] removing -Dtarget_EXPORTS (workaround)

Alexandru Ciobanu aciobanu at matrox.com
Thu Jul 12 10:20:15 EDT 2007


Hi, Bill!

Unfortunately this won't work because of:
 -  an Intel compiler bug/feature
 -  the way CMake positions flags in the command line

Namely, the -Dtarget_EXPORTS is always added first by CMake.
    icpc -Dtarget_EXPORTS ...FLAGS... -use-pch my.pchi

Adding the flag by hand would put it at the end:
    icpc ...FLAGS... -Dtarget_EXPORTS -create-pch my.pchi

For some reason, the Intel Compiler (as of v9.1.049) considers these
two to be different set of flags, hence issues the warning:
    Warning #672: the command line options do not match those used ...

Still, I am glad I have a workaround, because PCH is very important
in our project, it reduces compile time considerably. =)

Alex Ciobanu

Bill Hoffman wrote:
> Alexandru Ciobanu wrote:
>> Hi!
>>
>> I am posting the workaround I have found.
>>
>> Using the following command:
>>    set_target_properties ( mytgt PROPERTIES LINK_FLAGS DEFINE_SYMBOL 
>> "" )
>>
>> I get:
>>   icpc ...FLAGS... -create-pch my.pchi        ( create )
>>   icpc -D ...FLAGS... -use-pch my.pchi        ( use )
>> which is ok with the intel compiler.
>>
>> The -D seems to not bother it.
>>
>> Alex Ciobanu
> Seems like it would be easier to add the -D to the create step....
>
> -Bill
>
>



More information about the CMake mailing list