druidengine/druid

Move compiler flags from cmake files and into preset files.

Open

#21 aberto em 1 de out. de 2025

Ver no GitHub
 (0 comments) (0 reactions) (1 assignee)C++ (6 forks)auto 404
enhancementgood first issue

Métricas do repositório

Stars
 (3 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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.

Guia do colaborador