[CMake] CFlags being passed to Linker (OS X, ICC)

Mike Jackson imikejackson at gmail.com
Fri Feb 1 17:21:04 EST 2008


On Feb 1, 2008, at 5:06 PM, Bill Hoffman wrote:

> Mike Jackson wrote:
>> On Feb 1, 2008, at 4:46 PM, Bill Hoffman wrote:
>>> Mike Jackson wrote:
>>>>        On Feb 1, 2008, at 4:30 PM, Bill Hoffman wrote:
>>>>> Mike Jackson wrote:
>>>>>> I am trying to develop an icpc module file for Darwin and one  
>>>>>> of the problems that seems to be cropping up is that cmake is  
>>>>>> passing compiler flags to the linker. Specifically I have  
>>>>>> entered some values for CMAKE_CXX_FLAGS and the compile is  
>>>>>> fine but the linker gets all messed up:
>>>>>
>>>>> That is this stuff:
>>>>>
>>>>> SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
>>>>> SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
>>>>>
>> Just for giggles I used -Wd1170,981,383,424 instead of - 
>> wd1170,981,383,424 (note the capitalization difference). Beside  
>> ICC complaining that this was an unknown flag, the flag got passed  
>> unchanged to the linker, which the linker dealt with just fine.  
>> Just my observations.
>
> Mike, it has to be those variables.  That is the only way cmake  
> will remove a -w.   Note, Darwin.cmake will still be loaded even if  
> you have a Darwin-icpc.cmake.
>
>
> Put a message(${CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS}) in  
> your project...
>
> -Bill



Ok, I put the message in my project. Here is the output.

505:[mjackson at Thor:Build]$ cmake ../
-- -w
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mjackson/Workspace/FSTest/ 
Build


Also, I have access to a Linux box with ICPC Version 10.1.008 on it  
and I tried the same thing and it does work on the linux box. So,  
yes, something in my Darwin-icpc is messed up. Just not sure what.

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services




More information about the CMake mailing list