[CMake] Re: setting other compile flag for 1 source file

Jesper Eskilson jesper at eskilson.se
Mon Nov 26 02:11:46 EST 2007


Cees Wesseling wrote:
> Hi,
> 
> It seems that that is frequently requested feature for gcc but alas
> it is not implemented for gcc. Hence I am looking for another option
> to disable optimization op a per file level.

To specify file-specific compiler flags, use set_source_file_properties:

set_source_files_properties(weird-code.c
	PROPERTIES COMPILE_FLAGS -Wno-funny-opts)

--
/Jesper



More information about the CMake mailing list