/
premake5.lua
155 lines (141 loc) · 3.73 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
-- Box2D premake5 script.
-- https://premake.github.io/
workspace "Box2D"
location ( "Build/%{_ACTION}" )
architecture "x86_64"
configurations { "Debug", "Release" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
filter "configurations:Debug"
targetdir ( "Build/%{_ACTION}/bin/Debug" )
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
targetdir ( "Build/%{_ACTION}/bin/Release" )
defines { "NDEBUG" }
optimize "On"
cppdialect "C++11"
project "Box2D"
kind "StaticLib"
language "C++"
files { "Box2D/**.h", "Box2D/**.cpp" }
includedirs { "." }
buildoptions { "-fPIC" }
project "GLEW"
kind "StaticLib"
language "C++"
defines { "GLEW_STATIC" }
files { "glew/*.h", "glew/*.c" }
includedirs { "." }
buildoptions { "-fPIC" }
project "GLFW"
kind "StaticLib"
language "C"
files {
"glfw/internal.h",
"glfw/glfw_config.h",
"glfw/glfw3.h",
"glfw/glfw3native.h",
"glfw/context.c",
"glfw/init.c",
"glfw/input.c",
"glfw/monitor.c",
"glfw/vulkan.c",
"glfw/window.c" }
configuration { "windows" }
files {
"glfw/win32_platform.h",
"glfw/win32_joystick.h",
"glfw/wgl_context.h",
"glfw/egl_context.h",
"glfw/win32_init.c",
"glfw/win32_joystick.c",
"glfw/win32_monitor.c",
"glfw/win32_time.c",
"glfw/win32_tls.c",
"glfw/win32_window.c",
"glfw/wgl_context.c",
"glfw/egl_context.c"
}
configuration { "macosx" }
files {
"glfw/cocoa_platform.h",
"glfw/iokit_joystick.h",
"glfw/posix_tls.h",
"glfw/nsgl_context.h",
"glfw/egl_context.h",
"glfw/cocoa_init.m",
"glfw/cocoa_joystick.m",
"glfw/cocoa_monitor.m",
"glfw/cocoa_window.m",
"glfw/cocoa_time.c",
"glfw/posix_tls.c",
"glfw/nsgl_context.m",
"glfw/egl_context.c"
}
configuration { "not windows", "not macosx" }
files {
"glfw/x11_platform.h",
"glfw/xkb_unicode.h",
"glfw/linux_joystick.h",
"glfw/posix_time.h",
"glfw/posix_tls.h",
"glfw/glx_context.h",
"glfw/egl_context.h",
"glfw/x11_init.c",
"glfw/x11_monitor.c",
"glfw/x11_window.c",
"glfw/glx_context.h",
"glfw/glx_context.c",
"glfw/glext.h",
"glfw/xkb_unicode.c",
"glfw/linux_joystick.c",
"glfw/posix_time.c",
"glfw/posix_tls.c",
"glfw/glx_context.c",
"glfw/egl_context.c"
}
buildoptions { "-fPIC" }
project "IMGUI"
kind "StaticLib"
language "C++"
defines { "GLEW_STATIC" }
files { "imgui/*.h", "imgui/*.cpp" }
includedirs { "." }
buildoptions { "-fPIC" }
configuration { "macosx" }
defines { "GLFW_INCLUDE_GLCOREARB" }
project "HelloWorld"
kind "ConsoleApp"
language "C++"
files { "HelloWorld/HelloWorld.cpp" }
includedirs { "." }
links { "Box2D" }
project "Testbed"
kind "ConsoleApp"
language "C++"
defines { "GLEW_STATIC" }
files { "Testbed/**.h", "Testbed/**.cpp" }
includedirs { "." }
links { "Box2D", "GLFW", "IMGUI"}
configuration { "windows" }
links { "GLEW", "glu32", "opengl32", "winmm" }
configuration { "macosx" }
defines { "GLFW_INCLUDE_GLCOREARB" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework", "CoreFoundation.framework", "CoreVideo.framework"}
configuration { "linux" }
links { "GL", "GLU", "GLEW", "X11", "Xrandr", "Xinerama", "Xcursor", "pthread", "dl" }
project "Testbed_lib"
kind "SharedLib"
language "C++"
defines { "GLEW_STATIC" }
files { "Testbed/**.h", "Testbed/**.cpp" }
includedirs { "." }
links { "Box2D", "GLFW", "IMGUI"}
configuration { "windows" }
links { "GLEW", "glu32", "opengl32", "winmm" }
configuration { "macosx" }
defines { "GLFW_INCLUDE_GLCOREARB" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework", "CoreFoundation.framework", "CoreVideo.framework"}
configuration { "linux" }
links { "GL", "GLU", "GLEW", "X11", "Xrandr", "Xinerama", "Xcursor", "pthread", "dl" }