[CMake] Change Compiler flags for a single file.

Bill Lorensen bill.lorensen at gmail.com
Wed Feb 27 23:04:20 EST 2008


SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS -O0)

On Wed, Feb 27, 2008 at 10:21 PM, Surya Kiran Gullapalli
<suryakiran.gullapalli at gmail.com> wrote:
> Hello all,
> I'm building a project, where in one compilation of one file gets stuck due
> to optimization flag (-O3) with gcc. I want to turn off the optimization
> flag for that particular file only.
>
> I've done this.
>
> STRING (REPLACE "-O3" "" remove_opt_flag ${CMAKE_CXX_FLAGS_RELEASE})
> SET_SOURCE_FILES_PROPERTIES (${file} PROPERTIES CMAKE_CXX_FLAGS_RELEASE
> ${remove_opt_flag})
>
> But the changes are taken into account. How can i modify compilation flags
> for a single file?
>
> I'm using cmake-2.4.8 with gcc on linux.
>
> Thanks in advance,
> Surya
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list