forked from TheChernoCommunity/GameProject-0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
103 lines (94 loc) · 2.68 KB
/
premake5.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
local function configure_project_base()
-- Directories
location "build/%{_ACTION}/"
objdir "build/%{_ACTION}/%{cfg.platform}/%{cfg.buildcfg}/obj/"
targetdir "bin/%{cfg.buildcfg}/"
-- Single-value settings
cdialect "C11"
cppdialect "C++17"
exceptionhandling "On"
rtti "On"
warnings "Default"
staticruntime "On"
-- List settings
includedirs { "src/" }
sysincludedirs { "src/" }
-- Debug settings
filter "configurations:Debug"
optimize "Off"
symbols "On"
-- Release settings
filter "configurations:Release"
optimize "Full"
symbols "On"
-- Windows
filter "system:windows"
defines { "NOMINMAX", "WIN32_LEAN_AND_MEAN" }
systemversion "latest"
-- Reset filter
filter{}
end
workspace "GameProject-0"
startproject "Game"
platforms { io.popen("uname -m", "r"):read("*l") }
configurations { "Debug", "Release" }
group "ThirdParty"
project "SDL"
kind "StaticLib"
configure_project_base()
warnings "Off"
includedirs { "third_party/SDL/include/" }
files {
"third_party/SDL/src/*.c",
"third_party/SDL/src/*/*.c",
"third_party/SDL/src/*/dummy/*.c",
"third_party/SDL/src/render/software/*.c",
}
removefiles {
"third_party/SDL/src/main/dummy/SDL_dummy_main.c",
}
-- Windows settings
filter { "system:windows" }
files {
"third_party/SDL/src/*/windows/*.c",
"third_party/SDL/src/audio/directsound/*.c",
"third_party/SDL/src/audio/disk/*.c",
"third_party/SDL/src/audio/wasapi/*.c",
"third_party/SDL/src/audio/winmm/*.c",
"third_party/SDL/src/joystick/hidapi/*.c",
"third_party/SDL/src/render/direct3d/*.c",
"third_party/SDL/src/render/direct3d11/*.c",
"third_party/SDL/src/render/opengl/*.c",
"third_party/SDL/src/render/opengles2/*.c",
"third_party/SDL/src/thread/generic/SDL_syscond.c",
"third_party/SDL/src/video/yuv2rgb/*.c",
}
-- Linux settings
filter { "system:linux" }
files {
"third_party/SDL/src/*/unix/*.c",
"third_party/SDL/src/*/linux/*.c",
"third_party/SDL/src/render/opengl/*.c",
"third_party/SDL/src/thread/pthread/*.c",
}
group "Game"
project "Game"
kind "WindowedApp"
configure_project_base()
includedirs { "third_party/SDL/include/", "include" }
files { "src/**.cpp", "include/**.h" }
links { "SDL" }
-- Visual studio settings
filter "action:vs*"
vpaths {
["Headers"] = { "include/**.h" },
["Sources"] = {"src/**.cpp"},
}
-- Windows settings
filter { "system:windows" }
links {
"Winmm",
"version",
"Imm32",
"Setupapi",
}