druidengine/druid

Move compiler flags from cmake files and into preset files.

Open

#21 geöffnet am 1. Okt. 2025

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C++ (6 Forks)auto 404
enhancementgood first issue

Repository-Metriken

Stars
 (3 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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.

Contributor Guide