-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
69 lines (54 loc) · 1.48 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
workspace "RaySnake"
architecture "x86_64"
configurations { "Debug", "Release" }
libs = {}
libs["raylib"] = "%{wks.location}/libs/raylib"
libdirs {
"%{libs.raylib}/lib",
"%{libs.raylib}/bin"
}
intdir = "%{wks.location}/obj/%{cfg.buildcfg}-%{cfg.architecture}/%{prj.name}"
outdir = "%{wks.location}/bin/%{cfg.buildcfg}-%{cfg.architecture}/%{prj.name}"
newoption {
trigger = "raylibdyn",
description = "Use raylib dynamic lib",
}
project "Snake"
location "Snake"
language "C++"
cppdialect "C++17"
kind "ConsoleApp"
pchheader "pch.h"
pchsource "%{prj.location}/src/pch.cpp"
objdir ( intdir )
targetdir ( outdir )
files {
"%{prj.location}/src/**.cpp",
"%{prj.location}/src/**.h",
"%{prj.location}/src/**.rc",
"%{prj.location}/resources/**.*"
}
includedirs {
"%{prj.location}/src/",
"%{libs.raylib}/include"
}
if _OPTIONS["raylibdyn"] then
print("Going dynamic")
links {
"raylib"
}
postbuildcommands "{COPY} %{libs.raylib}/bin/raylib.dll %{outdir}"
else
print("Going static")
links {
"raylib_static"
}
end
postbuildcommands "{COPY} %{prj.location}/resources/ %{outdir}/resources/"
filter "Debug"
defines { "DEBUG" }
symbols "on"
filter "Release"
defines { "NDEBUG" }
optimize "on"
filter {} --Deselect filter