druidengine/druid

Move compiler flags from cmake files and into preset files.

Open

#21 建立於 2025年10月1日

在 GitHub 查看
 (0 留言) (0 反應) (1 負責人)C++ (6 fork)auto 404
enhancementgood first issue

倉庫指標

Star
 (3 star)
PR 合併指標
 (PR 指標待抓取)

描述

Is your feature request related to a problem? Please describe. I want to move the hard-coded compiler flags out of cmake configuration to allow users the flexibility to provide their own flags if they choose to not use cmake --preset and instead use cmake -DCMAKE_CXX_FLAGS=.

Describe the solution you'd like Currently, the compiler flags exist in cmake\project_compile_options.cmake. These flags need to be moved to their reespective use-<compiler>.json file found in cmake/preset/.

  • General compiler flags moved to:
    • use-clang.json
    • use-gcc.json
    • use-msvc.json
  • Create presets and move flags into:
    • use-clang-tsan.json. Inherits use-clang.
    • user-clang-asan.json. Inherits use-clang.
  • Create preset and move hardened flags into:
    • use-clang-hardened.json
    • use-gcc-hardened.json
    • use-msvc-hardened.json

Describe alternatives you've considered For the longest time, these flags remained in the cmake file to enfore all sub projects to use. With the advent of cmake presets this is no longer necessary to ensure quick, automatic, configuration.

Additional context I'm not 100% sure all the different compiler options work. They've been untested for a while.

貢獻者指南