Skip to content

VS2022 uses an invalid toolset for Linux #2526

@xoorath

Description

@xoorath

The issue

Generated Visual Studio 2022 projects seem to be using the wrong platform toolset when targeting Linux. I'm specifying the toolset as clang in lua and I've also tried msc-clang, msc-clang-cl and msc-Clang for Windows Subsystem for Linux.

What I've tried and expected

My expectations is that clang or msc-clang or some similar option should select the Clang for Windows Subsystem for Linux platform toolset for the generated project file.

What's actually happening when Linux is the active target:

toolset value in lua what I see in visual studio prop pages what I expect to see
clang Visual Studio 2022 (v143) (not installed) Clang for Windows Subsystem for Linux
msc Visual Studio 2022 (v143) (not installed) invalid or Visual Studio 2022 (v143) (not installed)
msc-clang clang (not installed) invalid or Clang for Windows Subsystem for Linux
clang-cl cl (not installed) invalid or Clang for Windows Subsystem for Linux
msc-clang-cl clang-cl (not installed) invalid or Clang for Windows Subsystem for Linux

Minimal repro case

I have a simple minimal example with the following layout:

<project root>/premake5.exe
<project root>/main.cpp
<project root>/premake5.lua

main.cpp

#include <iostream>

int main(int argc, char** argv)
{
    std::cout << "hello world" << std::endl;
    return 0;
}

premake5.lua

workspace "wrong-template"
    configurations { "Debug" }
    platforms { "linux" }
    toolset "clang"


project "wrong-template"
    kind "ConsoleApp"
    language "C++"
    files {  "main.cpp" }

I'm invoking premake with .\premake5.exe vs2022.

My VS2022 version is:

Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.14.18 (October 2025)

Premake5 version

premake5 (Premake Build Script Generator) 5.0.0-beta7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions