-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake4.lua
112 lines (81 loc) · 1.94 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
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
solution "EVP"
-- Options
newoption {
trigger = "arch",
description = "Architecture to target (32- or 64-bit)",
allowed = {
{"32", "32-bit"},
{"64", "64-bit"}
}
}
local is64bit = true
if _OPTIONS["arch"] == "64" then
is64bit = true
elseif _OPTIONS["arch"] == "32" then
is64bit = false
end
platforms {iif(is64bit, "x64", "x32")}
newoption {
trigger = "no-jpeg",
description = "Don't enable jpeg I/O"
}
newoption {
trigger = "no-png",
description = "Don't enable png I/O"
}
newoption {
trigger = "no-matio",
description = "Don't enable MAT file I/O"
}
-- Configurations
flags {"ExtraWarnings", "FatalWarnings"}
configurations {"Debug", "Release"}
configuration "Debug"
targetdir "bin"
flags {"Symbols"}
configuration "Release"
targetdir "bin"
flags {"OptimizeSpeed"}
-- Libraries/Defines
configuration "not macosx"
links {"OpenCL"}
configuration {"macosx", "gmake"}
linkoptions {"-framework OpenCL"}
configuration "xcode*"
links {"OpenCL.framework"}
defines {"NO_GL_INTEROP"}
if not _OPTIONS["no-jpeg"] then
links {"jpeg"}
else
defines {"EVP_NO_JPEG"}
end
if not _OPTIONS["no-png"] then
links {"png"}
configuration "macosx"
includedirs {"/usr/X11/include"}
libdirs {"/usr/X11/lib"}
else
defines {"EVP_NO_PNG"}
end
if not _OPTIONS["no-matio"] then
links {"matio"}
else
defines {"EVP_NO_MATIO"}
end
-- Prebuild
location "build"
dofile("embed.lua")
newaction {
trigger = "embed",
description = "Stringify OpenCL code",
execute = doembed
}
prebuildcommands {"cd ..; premake4 embed"}
-- Build
files {"**.hpp", "**.cl", "premake4.lua"}
project "evp"
kind "ConsoleApp"
language "C++"
targetname "evp"
includedirs {"deps/clip/include", "deps/evp/include"}
files {"src/evp/evp.cpp"}