forked from JDuverge/windirstat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake4.lua
130 lines (119 loc) · 5.08 KB
/
premake4.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
-- The below is used to insert the .vs(2005|2008|2010|2012) into the file names for projects and solutions
local action = _ACTION or ""
do
if not premake.project.getbasename then
print "Magic happens ..."
-- override the function to establish the behavior we'd get after patching Premake to have premake.project.getbasename
premake.project.getbasename = function(prjname, pattern)
return pattern:gsub("%%%%", prjname)
end
-- obviously we also need to overwrite the following to generate functioning VS solution files
premake.vstudio.projectfile = function(prj)
local pattern
if prj.language == "C#" then
pattern = "%%.csproj"
else
pattern = iif(_ACTION > "vs2008", "%%.vcxproj", "%%.vcproj")
end
local fname = premake.project.getbasename(prj.name, pattern)
fname = path.join(prj.location, fname)
return fname
end
-- we simply overwrite the original function on older Premake versions
premake.project.getfilename = function(prj, pattern)
local fname = premake.project.getbasename(prj.name, pattern)
fname = path.join(prj.location, fname)
return path.getrelative(os.getcwd(), fname)
end
end
local orig_getbasename = premake.project.getbasename
premake.project.getbasename = function(prjname, pattern)
if _ACTION then
pattern = pattern:gsub("%%%%", "%%%%." .. _ACTION)
end
return orig_getbasename(prjname, pattern)
end
end
solution ("windirstat")
configurations {"Debug", "Release"}
platforms {"x32", "x64"}
location ('.')
project ("windirstat")
local int_dir = "intermediate/" .. action .. "_" .. "$(PlatformName)_$(ConfigurationName)"
uuid ("BD11B94C-6594-4477-9FDF-2E24447D1F14")
language ("C++")
kind ("WindowedApp")
location ("windirstat")
targetname ("wds")
flags {"StaticRuntime", "Unicode", "MFC", "NativeWChar", "ExtraWarnings", "NoRTTI", "WinMain", "NoMinimalRebuild"}
defines {"WINVER=0x0500"}
targetdir ("build")
includedirs { "windirstat", "common", "windirstat/Controls", "windirstat/Dialogs" }
objdir (int_dir)
files
{
"common/*.h",
"common/*.cpp",
"windirstat/*.cpp",
"windirstat/Controls/*.cpp",
"windirstat/Dialogs/*.cpp",
"windirstat/*.c",
"windirstat/*.h",
"windirstat/Controls/*.h",
"windirstat/Dialogs/*.h",
"windirstat/windirstat.rc",
"windirstat/res/*.*",
"*.txt",
"common/BUILD",
"common/buildinc.cmd",
"premake4.lua",
}
excludes
{
"lua/src/premake.lua",
"lua/src/lua.c",
"lua/src/luac.c",
"lua/src/print.c",
"lua/src/**.lua",
"windirstat/stdafx.cpp",
}
vpaths
{
["Header Files/Common/*"] = { "common/*.h" },
["Header Files/Controls/*"] = { "windirstat/Controls/*.h" },
["Header Files/Dialogs/*"] = { "windirstat/Dialogs/*.h" },
["Header Files/*"] = { "windirstat/*.h" },
["Resource Files/*"] = { "windirstat/*.rc" },
["Resource Files/Resources/*"] = { "windirstat/res/*.*" },
["Source Files/Common/*"] = { "common/*.cpp" },
["Source Files/Lua/*"] = { "windirstat/WDS_Lua_C.c" },
["Source Files/Controls/*"] = { "windirstat/Controls/*.cpp" },
["Source Files/Dialogs/*"] = { "windirstat/Dialogs/*.cpp" },
["Source Files/*"] = { "windirstat/*.cpp" },
["Special Files/*"] = { "common/BUILD", "common/buildinc.cmd", "premake4.lua" },
["*"] = { "*.txt" },
}
configuration {"Debug", "x32"}
targetsuffix ("32D")
configuration {"Debug", "x64"}
targetsuffix ("64D")
configuration {"Release", "x32"}
targetsuffix ("32")
configuration {"Release", "x64"}
targetsuffix ("64")
configuration {"Debug"}
defines ("_DEBUG")
flags {"Symbols"}
configuration {"Release"}
defines ("NDEBUG")
flags {"Optimize"}
linkoptions {"/release"}
buildoptions {"/Oi", "/Ot"}
configuration {"vs*"}
links { "htmlhelp", "psapi" }
resoptions {"/nologo", "/l409"}
resincludedirs {"$(IntDir)"}
includedirs {".", "lua/src"}
--linkoptions {"/delayload:psapi.dll"}
configuration {"vs2005", "windirstat/WDS_Lua_C.c"}
defines ("_CRT_SECURE_NO_WARNINGS")