1newoption {
2   trigger     = "with-zlib",
3   description = "Build with zlib."
4}
5
6newoption {
7   trigger     = "with-zstd",
8   description = "Build with ZStandard compression."
9}
10
11newoption {
12   trigger     = "clang",
13   description = "Use clang compiler."
14}
15
16newoption {
17   trigger     = "asan",
18   description = "Enable AddressSanitizer(gcc or clang only)."
19}
20
21solution "objview"
22	-- location ( "build" )
23	configurations { "Release", "Debug" }
24	platforms {"native", "x64", "x32"}
25
26	project "objview"
27
28	kind "ConsoleApp"
29	language "C++"
30	files { "viewer.cc", "trackball.cc" }
31	includedirs { "./" }
32	includedirs { "../../" }
33
34	flags { "c++11" }
35
36        if _OPTIONS['clang'] then
37           toolset "clang"
38        end
39
40	if _OPTIONS['with-zlib'] then
41		defines { 'ENABLE_ZLIB' }
42		links { 'z' }
43	end
44
45	if _OPTIONS['asan'] then
46		buildoptions { '-fsanitize=address' }
47		linkoptions { '-fsanitize=address' }
48	end
49
50	if _OPTIONS['with-zstd'] then
51		print("with-zstd")
52		defines { 'ENABLE_ZSTD' }
53		-- Set path to zstd installed dir.
54		includedirs { '$$HOME/local/include' }
55		libdirs { '$$HOME/local/lib' }
56		links { 'zstd' }
57	end
58
59	-- Uncomment if you want address sanitizer(gcc/clang only)
60	--buildoptions { "-fsanitize=address" }
61	--linkoptions { "-fsanitize=address" }
62
63	configuration { "linux" }
64		linkoptions { "`pkg-config --libs glfw3`" }
65		links { "GL", "GLU", "m", "GLEW", "X11", "Xrandr", "Xinerama", "Xi", "Xxf86vm", "Xcursor", "dl" }
66		linkoptions { "-pthread" }
67
68	configuration { "windows" }
69		-- Path to GLFW3
70		includedirs { '../../../local/glfw-3.2.bin.WIN64/include' }
71		libdirs { '../../../local/glfw-3.2.bin.WIN64/lib-vc2015' }
72		-- Path to GLEW
73		includedirs { '../../../local/glew-1.13.0/include' }
74		libdirs { '../../../local/glew-1.13.0/lib/Release/x64' }
75
76		links { "glfw3", "glew32", "gdi32", "winmm", "user32", "glu32","opengl32", "kernel32" }
77		defines { "_CRT_SECURE_NO_WARNINGS" }
78		defines { "NOMINMAX" }
79
80	configuration { "macosx" }
81		includedirs { "/usr/local/include" }
82		buildoptions { "-Wno-deprecated-declarations" }
83		libdirs { "/usr/local/lib" }
84		links { "glfw3", "GLEW" }
85		linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" }
86
87	configuration "Debug"
88		defines { "DEBUG" }
89		flags { "Symbols"}
90
91	configuration "Release"
92		defines { "NDEBUG" }
93		flags { "Optimize"}
94
95