[CMake] Change Compiler flags for a single file.

Surya Kiran Gullapalli suryakiran.gullapalli at gmail.com
Wed Feb 27 22:21:56 EST 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080228/8fd7f9df/attachment.html


More information about the CMake mailing list