Configurations_clang.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. include(cmake/Platform/Common/Configurations_common.cmake)
  9. ly_append_configurations_options(
  10. DEFINES_PROFILE
  11. _FORTIFY_SOURCE=2
  12. DEFINES_RELEASE
  13. _FORTIFY_SOURCE=2
  14. COMPILATION
  15. -fno-exceptions
  16. -fvisibility=hidden
  17. -fvisibility-inlines-hidden
  18. -Wall
  19. -Werror
  20. ###################
  21. # Disabled warnings (please do not disable any others without first consulting sig-build)
  22. ###################
  23. -Wno-inconsistent-missing-override # unfortunately there is no warning in MSVC to detect missing overrides,
  24. # MSVC's static analyzer can, but that is a different run that most developers are not aware of. A pass
  25. # was done to fix all hits. Leaving this disabled until there is a matching warning in MSVC.
  26. -Wrange-loop-analysis
  27. -Wno-unknown-warning-option # used as a way to mark warnings that are MSVC only
  28. -Wno-parentheses
  29. -Wno-reorder
  30. -Wno-switch
  31. -Wno-undefined-var-template
  32. ###################
  33. # Enabled warnings (that are disabled by default)
  34. ###################
  35. COMPILATION_DEBUG
  36. -O0 # No optimization
  37. -g # debug symbols
  38. -fno-inline # don't inline functions
  39. -fstack-protector-all # Enable stack protectors for all functions
  40. -fstack-check
  41. COMPILATION_PROFILE
  42. -O2
  43. -g # debug symbols
  44. -fstack-protector-all # Enable stack protectors for all functions
  45. -fstack-check
  46. COMPILATION_RELEASE
  47. -O2
  48. )
  49. if(LY_BUILD_WITH_ADDRESS_SANITIZER)
  50. ly_append_configurations_options(
  51. COMPILATION_DEBUG
  52. -fsanitize=address
  53. -fno-omit-frame-pointer
  54. LINK_NON_STATIC_DEBUG
  55. -shared-libsan
  56. -fsanitize=address
  57. )
  58. endif()
  59. include(cmake/Platform/Common/TargetIncludeSystemDirectories_supported.cmake)