[CMake] cmake removing "-w" from compile flag

Derek Cole derek.cole at gmail.com
Mon Jul 16 14:43:57 EDT 2012


err, nevermind, i think that is a non-standard option or something. I am
compiling someone's existing code and that is something leftover I think.

-Derek

On Mon, Jul 16, 2012 at 11:44 AM, Derek Cole <derek.cole at gmail.com> wrote:

> Hello,
>
> I have a CMake project with a few sub-projects to be built as well. In one
> of the sub projects I want to compile to a shared object. I used the line
>
> add_library(myfiles SHARED myfiles.c)
>
>
> in the main project's CMakeLists.txt I have
>
> SET(CMAKE_C_FLAGS_DEBUG "-g -fPIC -O0 -pipe -std=c99 -wOff")
>
>
>
> and yet I am getting an error that "Off is not a file or directory"
> because the compile line looks like:
>
> usr/bin/gcc -g -fPIC -O0 -pipe -std=c99 Off -dynamiclib
> -Wl,-headerpad_max_install_names ....
>
>
> so it seems like cmake stripped off the -w from -wOff? Is this a bug? It
> doesnt seem to be a problem if I change the library to "STATIC" instead of
> SHARED
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120716/c599f6ad/attachment.htm>


More information about the CMake mailing list