[CMake] Add_definitions() also affects RC_FLAGS ?
Bill Hoffman
bill.hoffman at kitware.com
Sun Jun 22 15:25:21 EDT 2008
Christian Ehrlicher wrote:
> Hi,
>
> We've something like this in one of our scripts:
>
> add_definitions(-EHsc)
> and we add a .rc - file to the sources.
> Now rc.exe fails because of unknown command '-EHsc' because
> add_defintions() is also dded to RC_FLAGS... :(
>
> [ 85%] Building RC object ksirk/ksirk/CMakeFiles/ksirk.dir/ksirk.res
> fatal error RC1106: invalid option: -EHsc
>
>
> Any idea how to fix this?
Don't use add_definitions for compiler flags. Use CMAKE_CXX_FLAGS or
CMAKE_C_FLAGS.
-Bill
More information about the CMake
mailing list