[Libwebsockets] Building libwebsockets with different CFLAGS

marty leisner maleisner at gmail.com
Mon Aug 10 23:54:10 CEST 2015


I want to build libwebsockets with -O -g (instead of -O3)

I figured this would work:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43630f7..08a3d61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -396,13 +396,13 @@ if (UNIX)
 endif()

 if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-    include (CheckCCompilerFlag)
-    CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY)
+#    include (CheckCCompilerFlag)
+#    CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY)
     if (HAVE_VISIBILITY)
                 set(VISIBILITY_FLAG -fvisibility=hidden)
     endif()
     if (UNIX)
-           set(CMAKE_C_FLAGS "-Wall -Werror -O3 ${VISIBILITY_FLAG}
${CMAKE_C_FLAGS}" )
+         set(CMAKE_C_FLAGS "-Wall -Werror -O -g -DNDEBUG" )
     else(UNIX)
                set(CMAKE_C_FLAGS "-Wall -O3 ${VISIBILITY_FLAG}
${CMAKE_C_FLAGS}" )
     endif(UNIX)
~

But it doesn't, I'm still getting:
/usr/bin/cc   -Wall -Werror -O -g -DNDEBUG -O3 -DNDEBUG
-I/usr/local/src/network/git/libwebsockets-linux/build
-I/usr/local/src/network/git/libwebsockets-linux/lib    -o
CMakeFiles/websockets.dir/lib/ssl.c.o   -c
/usr/local/src/network/git/libwebsockets-linux/lib/ssl.c

I don't know where the -O3 -DNDEBUG is coming from -- I can't seem to get
rid of it.

What I'd really like to be able to do is "override this" at make time (but
it seems I can't).
Even trying to change this upfront doesn't seem to work.

marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20150810/9b2d4393/attachment.html>


More information about the Libwebsockets mailing list