File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ option(FLB_SMALL "Optimise for small size" No)
156
156
set (FLB_SECURITY "ReleaseOnly" CACHE STRING "Build with security optimizations" )
157
157
set_property (CACHE FLB_SECURITY PROPERTY STRINGS "On;Off;ReleaseOnly" )
158
158
option (FLB_COVERAGE "Build with code-coverage" No )
159
+ option (FLB_DENY_INCOMPATIBLE_TYPES "Build with -Werror=incompatible-pointer-types" No )
159
160
option (FLB_JEMALLOC "Build with Jemalloc support" No )
160
161
option (FLB_REGEX "Build with Regex support" Yes )
161
162
option (FLB_UTF8_ENCODER "Build with UTF8 encoding support" Yes )
@@ -436,6 +437,12 @@ if(FLB_COVERAGE)
436
437
set (CMAKE_BUILD_TYPE "Debug" )
437
438
endif ()
438
439
440
+ if (FLB_DENY_INCOMPABLE_TYPES )
441
+ if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang" )
442
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types" )
443
+ endif ()
444
+ endif ()
445
+
439
446
# Enable Debug symbols if specified
440
447
if (MSVC )
441
448
set (CMAKE_BUILD_TYPE None ) # Avoid flag conflicts (See CMakeList.txt:L18)
You can’t perform that action at this time.
0 commit comments