forked from diegostamigni/efsw
-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake4.lua
109 lines (91 loc) · 2.54 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
function args_contains( element )
for _, value in pairs(_ARGS) do
if value == element then
return true
end
end
return false
end
solution "efsw"
location("./make/" .. os.get() .. "/")
targetdir("./bin")
configurations { "debug", "release" }
if os.is("windows") then
osfiles = "src/efsw/platform/win/*.cpp"
else
osfiles = "src/efsw/platform/posix/*.cpp"
end
-- This is for testing in other platforms that don't support kqueue
if args_contains( "kqueue" ) then
links { "kqueue" }
defines { "EFSW_KQUEUE" }
printf("Forced Kqueue backend build.")
end
-- Activates verbose mode
if args_contains( "verbose" ) then
defines { "EFSW_VERBOSE" }
end
if os.is("macosx") then
-- Premake 4.4 needed for this
if not string.match(_PREMAKE_VERSION, "^4.[123]") then
local ver = os.getversion();
if not ( ver.majorversion >= 10 and ver.minorversion >= 5 ) then
defines { "EFSW_FSEVENTS_NOT_SUPPORTED" }
end
end
end
objdir("obj/" .. os.get() .. "/")
project "efsw-static-lib"
kind "StaticLib"
language "C++"
targetdir("./lib")
includedirs { "include", "src" }
files { "src/efsw/*.cpp", osfiles }
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
buildoptions{ "-Wall -pedantic -Wno-long-long" }
targetname "efsw-static-debug"
configuration "release"
defines { "NDEBUG" }
flags { "Optimize" }
targetname "efsw-static-release"
project "efsw-test"
kind "ConsoleApp"
language "C++"
links { "efsw-static-lib" }
files { "src/test/*.cpp" }
includedirs { "include", "src" }
if not os.is("windows") and not os.is("haiku") then
links { "pthread" }
end
if os.is("macosx") then
links { "CoreFoundation.framework", "CoreServices.framework" }
end
configuration "debug"
defines { "DEBUG" }
flags { "Symbols" }
buildoptions{ "-Wall" }
targetname "efsw-test-debug"
configuration "release"
defines { "NDEBUG" }
flags { "Optimize" }
buildoptions{ "-Wall" }
targetname "efsw-test-release"
project "efsw-shared-lib"
kind "SharedLib"
language "C++"
targetdir("./lib")
includedirs { "include", "src" }
files { "src/efsw/*.cpp", osfiles }
defines { "EFSW_DYNAMIC", "EFSW_EXPORTS" }
configuration "debug"
defines { "DEBUG" }
buildoptions{ "-Wall" }
flags { "Symbols" }
targetname "efsw-debug"
configuration "release"
defines { "NDEBUG" }
flags { "Optimize" }
buildoptions{ "-Wall" }
targetname "efsw"