-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
109 lines (87 loc) · 1.85 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
local function get_os()
local mapping = {
["macosx"] = "darwin",
["linux"] = "linux"
}
return mapping[_TARGET_OS]
end
local OS = get_os()
local BUILD_DIR = "./.build"
local PROJECTS_DIR = path.join(BUILD_DIR, "projects")
local TARGET_DIR = path.join(BUILD_DIR, "bin", OS)
require "clang_complete"
workspace "b4re"
configurations { "debug", "release" }
location(path.join(PROJECTS_DIR, OS))
project "entry"
kind "WindowedApp"
language "C"
targetdir(path.join(TARGET_DIR, "%{cfg.buildcfg}"))
flags { "FatalWarnings" }
files {
"src/**.h", "src/**.c",
"3rdparty/tinycthread/*.c",
"3rdparty/gb/*.c",
"3rdparty/stb/*.c",
"3rdparty/fontstash/*.c",
"3rdparty/jsmn/*.c"
}
includedirs { "src" }
sysincludedirs {
"3rdparty/bgfx/include",
"3rdparty/curl/include",
"3rdparty/tinycthread",
"3rdparty/gb",
"3rdparty/stb",
"3rdparty/fontstash",
"3rdparty/jsmn"
}
links {
-- TODO: Use release libraries for release configuration.
"curlDebug",
"bgfxRelease",
"bimgRelease",
"bxRelease",
-- "bgfxDebug",
-- "bimgDebug",
-- "bxDebug",
}
filter "configurations:debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:release"
defines { "NDEBUG" }
optimize "On"
filter "system:windows"
defines { "BR_PLATFORM_WIN" }
filter "system:macosx"
defines { "BR_PLATFORM_MACOS" }
libdirs {
"3rdparty/bgfx/lib/osx_x64",
"3rdparty/curl/lib/macosx_x64"
}
files { "src/**.m", "src/Info.plist" }
links {
"stdc++",
"objc",
"Foundation.framework",
"Security.framework",
"AppKit.framework",
"QuartzCore.framework",
"Metal.framework",
"OpenGL.framework"
}
filter "system:linux"
defines { "BR_PLATFORM_LINUX" }
libdirs {
"3rdparty/curl/lib/linux_x64",
"3rdparty/bgfx/lib/linux_x64"
}
links {
"stdc++",
"m",
"dl",
"pthread",
"X11",
"GL"
}