ports/devel/libyajl/patches/patch-CMakeLists_txt

21 lines
1.2 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Check for compiler flags not available with gcc < 4.
--- CMakeLists.txt.orig Tue Dec 20 01:23:22 2011
+++ CMakeLists.txt Sat Nov 2 11:38:51 2013
@@ -54,9 +54,14 @@ ELSE (WIN32)
IF(HAVE_GCC_VISIBILITY)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
ENDIF(HAVE_GCC_VISIBILITY)
+ CHECK_C_COMPILER_FLAG(-Wold-style-definition HAVE_GCC_WOLDSTYLE)
+ IF(HAVE_GCC_WOLDSTYLE)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wold-style-definition")
+ ENDIF(HAVE_GCC_WOLDSTYLE)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS
- "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes")
+ "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes")
+
SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g")
SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2 -Wuninitialized")