[CMake] swig - how do I set compile flags on the generated files?
Nick Overdijk
nick at astrant.net
Tue Nov 27 19:22:00 EST 2012
Aren't you the one generating those names?
http://www.swig.org/Doc1.3/Introduction.html#Introduction%5Fbuild%5Fsystem
On 2012-28-11, at 01:11:24 , Miller Henry wrote:
> Our normal coding standards requires zero warnings with –wall –wextra (gcc/clang), but often the swig generated file has warnings. We don’t mind turning these warnings off for the generated file, but we still want to see them for other files in the project. However I’m stumped on how to do this.
>
> Currently I have
>
> ADD_DEFINITIONS(-Wno-unused-parameter …)
>
> which works but it disables the warning for non-generated files as well.
>
> I understand the right way to do this is by:
>
> Set_source_files_property(filename PROPERTIES COMPILE_FLAGS “-Wno-unused-parameter …”)
>
> However I don’t have filename. Instead I have myInputfile.i, which gets turns into something like myInputFilePYTHON_wrap.cxx. Of course I can generate this name, but that seems fragile: if cmake desides to change the file mangling in the future I need to change my algorithm.
>
> So the question is either: is there are good way to get the generated filename, or is there a different way I should be doing this?
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121128/72ea0a9d/attachment.htm>
More information about the CMake
mailing list