example.cmake 789 B

12345678910111213141516171819202122232425262728293031
  1. target_compile_options(${PROJECT} PUBLIC
  2. -Wall
  3. -Wextra
  4. -Werror
  5. -Wfatal-errors
  6. -Wdouble-promotion
  7. #-Wstrict-prototypes
  8. -Wstrict-overflow
  9. #-Werror-implicit-function-declaration
  10. -Wfloat-equal
  11. #-Wundef
  12. -Wshadow
  13. -Wwrite-strings
  14. -Wsign-compare
  15. -Wmissing-format-attribute
  16. -Wunreachable-code
  17. -Wcast-align
  18. -Wcast-function-type
  19. -Wcast-qual
  20. -Wnull-dereference
  21. -Wuninitialized
  22. -Wunused
  23. -Wredundant-decls
  24. )
  25. # GCC version 9 or prior has a bug with incorrect Wconversion warnings
  26. if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
  27. target_compile_options(${PROJECT} PUBLIC
  28. -Wconversion
  29. )
  30. endif()