Skip to content

Commit e35e514

Browse files
committed
[project] Add project enablewarnings
1 parent 912b4ac commit e35e514

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

projects/enablewarnings/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## enablewarnings
2+
3+
Test [`enablewarnings`](https://premake.github.io/docs/enablewarnings)

projects/enablewarnings/failed_build_expected

Whitespace-only changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if (_ACTION == nil) then
2+
return
3+
end
4+
5+
local LocationDir = "solution/%{_ACTION}"
6+
7+
workspace "Project"
8+
location(LocationDir)
9+
configurations {"Debug", "Release"}
10+
11+
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName)
12+
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))
13+
startproject "app"
14+
15+
project "app"
16+
kind "ConsoleApp"
17+
targetname "app"
18+
19+
files { "src/main.cpp" }
20+
21+
warning "Off"
22+
fatalwarnings "All"
23+
24+
filter "toolset:msc*"
25+
enablewarnings {
26+
"4035", -- '%function': no return value
27+
"4716", -- '%function': must return a value
28+
}
29+
filter "toolset:not msc*"
30+
enablewarnings {
31+
"return-type"
32+
}
33+
filter {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
int foo() {} // missing return
2+
3+
int main()
4+
{
5+
}

0 commit comments

Comments
 (0)