Skip to content

Commit

Permalink
CMake: Fix build on clang
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed May 29, 2023
1 parent b80797a commit d432ec3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ if(NOT MSVC)
# mingw32 likes to complain about using the "wrong" format strings despite them actually working
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-format")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -fwrapv")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration -Werror=implicit-int -fwrapv")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
# TODO: Remove this once mScript KV pairs support const correctness
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146 /wd4267 /Zc:preprocessor-")
Expand Down

0 comments on commit d432ec3

Please sign in to comment.