Toolchain File vs Environment Variables: Which Precedence Should CMake Use for Compiler Selection?
Goal Determine the reliable compiler selection when both a toolchain file and environment variables (e.g., CMAKE_C_COMPILER ) are supplied for cross‑compilation on Windows. Constraint Both mechanisms are documented and can coexist, yet the CMake documentation does not specify a clear precedence rule, leading to inconsistent build outputs across generators. U