-
Notifications
You must be signed in to change notification settings - Fork 2
/
premake4.lua
64 lines (49 loc) · 1.57 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
solution "zc"
local sdl2_config = "sdl2-config"
if _ACTION == "clean" then
os.rmdir("build")
elseif _ACTION == "gmake" and os.is("windows") then
local mingw32 = "i686-w64-mingw32"
premake.gcc.cc = mingw32 .. "-gcc" -- set cross-compiler
sdl2_config = "/usr/" .. mingw32 .. "/sys-root/mingw/bin/" .. sdl2_config
if not os.isfile(sdl2_config) then
printf("WARNING: '%s' cannot be found.", sdl2_config)
end
end
newoption {
trigger = "with-hd-textures",
description = "Enables HD textures by Kenney"
}
location "build"
objdir "build"
targetdir "build"
language "C"
configurations { "debug", "release" }
includedirs { "src" }
configuration "debug"
defines { "ZC_DEBUG" }
configuration "release"
defines { "ZC_NDEBUG" }
configuration "with-hd-textures"
defines { "ZC_WITH_HD_TEXTURES" }
configuration { "gmake" }
buildoptions { "-O3" }
configuration { "gmake" }
buildoptions { "`" .. sdl2_config .. " --cflags`" }
linkoptions { "`" .. sdl2_config .. " --libs`" }
configuration { "windows", "gmake" }
links { "opengl32", "glu32" }
configuration { "macosx", "gmake" }
links { "OpenGL.framework" }
configuration { "linux", "gmake" }
links { "GL", "GLU", "m" }
configuration { "linux", "debug", "gmake" }
buildoptions { "-Wall", "-Wextra", "-Werror", "-ansi", "-pedantic" }
defines { "_GNU_SOURCE" }
project "zc"
if os.is("macosx") then -- Avoid creating an '.app' bundle
kind "ConsoleApp"
else
kind "WindowedApp"
end
files { "src/**.c" }