-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
139 lines (101 loc) · 2.64 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
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
131
132
133
134
135
136
137
workspace "PumpkinBox"
architecture "x64"
startproject "SandboxApp"
configurations
{
"Debug",
"Release",
"Dist"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
IncludeDir = {}
-- INCLUDE DIRECTORIES
IncludeDir["glm"] = "PumpkinBox/vendor/glm"
IncludeDir["imgui"] = "PumpkinBox/vendor/imgui"
IncludeDir["glfw"] = "PumpkinBox/vendor/GLFW/include"
IncludeDir["glad"] = "PumpkinBox/vendor/Glad/include"
IncludeDir["spdlog"] = "PumpkinBox/vendor/spdlog/include"
IncludeDir["catch2"] = "PumpkinBox/vendor/Catch2"
-- EXAMPLE PROJECTS INCLUDES
include "Examples/Pong/pong.premake5.lua"
include "Examples/Sandbox/sandbox.premake5.lua"
include "Examples/EcsTest/ecstest.premake5.lua"
include "Examples/Platformer/platformer.premake5.lua"
-- DEPENDENCIES INCLUDES
include "PumpkinBox/vendor/glad.premake5.lua"
include "PumpkinBox/vendor/glfw.premake5.lua"
include "PumpkinBox/vendor/imgui.premake5.lua"
-- OPSCORE PROJECT BUILD CONFIGURATION
project "PumpkinBox"
location "PumpkinBox"
kind "StaticLib"
language "C++"
staticruntime "on"
cppdialect "C++17"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
-- Precompiled headers
pchheader "pbpch.h"
pchsource "%{prj.name}/src/pbpch.cpp" -- only necessary for visual studio
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
"%{IncludeDir.glm}/glm/**.hpp",
"%{IncludeDir.glm}/glm/**.inl",
"%{IncludeDir.catch2}/catch2.hpp"
}
includedirs
{
"%{prj.name}/src",
"%{IncludeDir.spdlog}",
"%{IncludeDir.glfw}",
"%{IncludeDir.glad}",
"%{IncludeDir.imgui}",
"%{IncludeDir.glm}",
"%{IncludeDir.catch2}"
}
links{
"GLFW",
"opengl32.lib",
"Glad",
"ImGui"
}
defines
{
"GLFW_INCLUDE_NONE"
}
filter "system:linux"
links
{
"Xrandr",
"Xi",
"GLEW",
"GLU",
"GL",
"X11"
}
filter {"system:windows","configurations:Debug"}
defines "PB_DEBUG"
buildoptions "/MDd"
symbols "On"
filter {"system:windows", "configurations:Release"}
defines "PB_RELEASE"
buildoptions "/MD"
optimize "On"
filter {"system:windows", "configurations:Dist"}
defines "PB_DIST"
buildoptions "/MD"
optimize "On"
filter {"system:macosx", "configurations:Debug"}
defines "PB_DEBUG"
symbols "On"
filter {"system:macosx", "configurations:Release"}
defines "PB_RELEASE"
optimize "On"
filter {"system:macosx", "configurations:Dist"}
defines "PB_RELEASE"
optimize "On"
filter {"system:linux", "configurations:Debug"}
defines "PB_DEBUG"
symbols "On"