Configurations_clang.cmake 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. -fno-relaxed-template-template-args
  33. -Wno-deprecated-no-relaxed-template-template-args
  34. ###################
  35. # Enabled warnings (that are disabled by default)
  36. ###################
  37. COMPILATION_DEBUG
  38. -O0 # No optimization
  39. -g # debug symbols
  40. -fno-inline # don't inline functions
  41. -fstack-protector-all # Enable stack protectors for all functions
  42. -fstack-check
  43. COMPILATION_PROFILE
  44. -O2
  45. -g # debug symbols
  46. -fstack-protector-all # Enable stack protectors for all functions
  47. -fstack-check
  48. COMPILATION_RELEASE
  49. -O2
  50. )
  51. if(LY_BUILD_WITH_ADDRESS_SANITIZER)
  52. ly_append_configurations_options(
  53. COMPILATION_DEBUG
  54. -fsanitize=address
  55. -fno-omit-frame-pointer
  56. LINK_NON_STATIC_DEBUG
  57. -shared-libsan
  58. -fsanitize=address
  59. )
  60. endif()
  61. include(cmake/Platform/Common/TargetIncludeSystemDirectories_supported.cmake)