Skip to content

Commit 12b7529

Browse files
committed
build: Use add_compile_options to specify compile options
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 5dced09 commit 12b7529

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,12 @@ endif()
449449

450450
if(FLB_COMPILER_STRICT_POINTER_TYPES)
451451
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
452-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types")
452+
add_compile_options(-Werror=incompatible-pointer-types)
453+
endif()
454+
# Currently, AppleClang has more struct rules when using -Werror=incompatible-pointer-types.
455+
# We still permit to discarding const qualifiers warnings.
456+
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang")
457+
add_compile_options(-Wno-incompatible-pointer-types-discards-qualifiers)
453458
endif()
454459
endif()
455460

0 commit comments

Comments
 (0)