What seems to be the problem?
When using toolset "clang", which will use clang-cl under VS, Premake incorrectly generates the arguments for disablewarnings. It generates with -Wno-[number] instead of /wd[number], which are only supported in clang-cl for clang specific options via the /clang: flag (eg. /clang:-Wno-c99-designator).
Seems to been introduced in this PR here: #2529
What did you expect to happen?
It should have generated: /wd28251 /wd4996 /wd4800 for the input disablewarnings { "28251", "4996", "4800" }, but instead generates -Wno-28251 -Wno-4996 -Wno-4800
Currently the workaround involves issuing the correct option via buildoptions like so:
filter "toolset:clang"
buildoptions { "/wd28251", "/wd4996", "/wd4800" }
filter {}
Minimal example:
premake5.lua
workspace "test"
configurations { "Debug" }
platforms { "x64" }
filter "configurations:Debug"
defines { "_DEBUG" }
symbols "On"
filter {}
enablepch "Off"
multiprocessorcompile "On"
disablewarnings { "28251", "4996", "4800" }
project "testapp1"
location "src"
kind "ConsoleApp"
toolset "clang"
files { "src/**.hpp", "src/**.cpp" }
main.cpp
#include <stdio.h>
int main() {
printf("hallo :)");
return 0;
}
Tested with:
What version of Premake are you using?
PS C:\Users\Laura> premake5 --version
premake5 (Premake Build Script Generator) 5.0.0-beta8
What seems to be the problem?
When using
toolset "clang", which will use clang-cl under VS, Premake incorrectly generates the arguments fordisablewarnings. It generates with-Wno-[number]instead of/wd[number], which are only supported in clang-cl for clang specific options via the/clang:flag (eg./clang:-Wno-c99-designator).Seems to been introduced in this PR here: #2529
What did you expect to happen?
It should have generated:
/wd28251 /wd4996 /wd4800for the inputdisablewarnings { "28251", "4996", "4800" }, but instead generates-Wno-28251 -Wno-4996 -Wno-4800Currently the workaround involves issuing the correct option via
buildoptionslike so:Minimal example:
premake5.lua
main.cpp
Tested with:
What version of Premake are you using?