[CMake] setting other compile flag for 1 source file

Bill Lorensen bill.lorensen at gmail.com
Sun Nov 25 12:58:05 EST 2007


Cees,

You can set compiler flags on individual files using
SET_SOURCE_FILES_PROPERTIES.

IF(CMAKE_COMPILER_IS_GNUCC)
SET_SOURCE_FILES_PROPERTIES(
  mycode.cxx
  PROPERTIES COMPILE_FLAGS -O0
 )
ENDIF(CMAKE_COMPILER_IS_GNUCC)

Bill

On Nov 18, 2007 10:32 AM, Cees Wesseling <cwesseling at esri.com> wrote:

> Hi,
>
> On a large project I am running into a possible optimization bug in gcc.
> I nailed the problem down to 1 source file. To bypass the problem I want
> to compile the offending source file, with no optimization instead of
> the default settings for release mode.
>
> Is there already a mechanism for that in cmake that I can't find or do I
> just have to build a custom rule for that file?
>
> Any hints how to do this most efficiently are appreciated.
>
> Thanks, Cees
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071125/7101d6a2/attachment.htm


More information about the CMake mailing list