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

Derek Cole derek.cole at gmail.com
Mon Jul 16 11:44:58 EDT 2012


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/0759a023/attachment.htm>


More information about the CMake mailing list