[CMake] CXX_COMPILER_FLAGS also passed to the linker?

Bill Hoffman bill.hoffman at kitware.com
Wed Jan 3 11:08:08 EST 2007


Mike Jackson wrote:
>
> 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?
Sure, you should create a Darwin-icpc.cmake and put the set's in there, 
if that works, you can send me the file.
Would you be able to run a dashboard for icpc?

-Bill



More information about the CMake mailing list