[CMake] CXX_COMPILER_FLAGS also passed to the linker?

Mike Jackson mike.jackson at imts.us
Wed Jan 3 10:11:47 EST 2007


On Jan 3, 2007, at 9:51 AM, Bill Hoffman wrote:

> Mike Jackson wrote:
>>
>> Bill,
>>   icpc is the Intel C++ compiler. icc is the C compiler.
>>
>> Exactly.. the flags _do not_ match. If you look closely in all the  
>> mumbo jumbo.. in the compile the flag is "-wd981" but in the link  
>> phase the flag is "d981". note the missing characters up front.  
>> This is causing the problems. So.. CMake bug or operator error?
> OK, I know where the problem is....
>
> In Darwin.cmake there is this:
>
> SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
> SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
>
> CMake removes -w because it does not work during the linker stage.   
> Can you try setting those
> to empty in your project and see if it works.   The better solution  
> will be to fix the c++ code
> so that it only removes -w, or removes -w....  up to the next space.
>
> -Bill
>
>

Yep that works when using the Intel Compiler. I also noticed that in  
addition to Dawin.cmake there is also Darwin-xlc.cmake. Could there  
also be a Darwin-icc.cmake added to cmake since Intel now has a  
compiler for OS X?

Thanks for the help.

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




More information about the CMake mailing list