[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Re-defining CMAKE_CXX_FLAGS with /TP for cl.exe
From:       Bill Hoffman <bill.hoffman () kitware ! com>
Date:       2009-06-30 13:27:14
Message-ID: 4A4A12B2.1070508 () kitware ! com
[Download RAW message or body]

Knox, Kent wrote:
> I've just stumbled across some surprising cl.exe behavior, and I
> would like to see if the collective minds of this dist list has come
> across this before.
> 
> In my c++ project, I override CMAKE_CXX_FLAGS with my own flags,
> including /TP.  Using an nmake based build, this causes the linking
> step to bomb.  Enabling verbose mode for nMake, I saw that /TP was
> actually being defined twice, once by me and I suppose cMake did too
> for good measure.  By eliminating my flags one by one, I found that
> my /TP caused the link problem.
> 
> This is using cmake 2.6.4, 64bit MSVC tools and nmake generator.
> Snippet of error log below.  Does this make sense to anybody?
> 

CMake automatically sets the compiler to pick the correct language, so 
you should not need /TP.  CMake also uses the CXX Flags during the link 
phase, and if you use /TP the compiler treats the .obj file like a c++ 
file.   I guess CMake should filter out the /TP flag for linking, but 
there is no reason for you to add that flag in the first place.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic