1 | package.name = "drawstuff" |
---|
2 | package.language = "c++" |
---|
3 | package.objdir = "obj/drawstuff" |
---|
4 | |
---|
5 | |
---|
6 | -- Separate distribution files into toolset subdirectories |
---|
7 | |
---|
8 | if (options["usetargetpath"]) then |
---|
9 | package.path = options["target"] |
---|
10 | else |
---|
11 | package.path = "custom" |
---|
12 | end |
---|
13 | |
---|
14 | |
---|
15 | -- Package Build Settings |
---|
16 | |
---|
17 | local dll_defines = |
---|
18 | { |
---|
19 | "DS_DLL", |
---|
20 | "USRDLL" |
---|
21 | } |
---|
22 | |
---|
23 | local lib_defines = |
---|
24 | { |
---|
25 | "DS_LIB" |
---|
26 | } |
---|
27 | |
---|
28 | if (options["enable-shared-only"]) then |
---|
29 | package.kind = "dll" |
---|
30 | table.insert(package.defines, dll_defines) |
---|
31 | elseif (options["enable-static-only"]) then |
---|
32 | package.kind = "lib" |
---|
33 | table.insert(package.defines, lib_defines) |
---|
34 | else |
---|
35 | package.config["DebugDLL"].kind = "dll" |
---|
36 | package.config["DebugLib"].kind = "lib" |
---|
37 | package.config["ReleaseDLL"].kind = "dll" |
---|
38 | package.config["ReleaseLib"].kind = "lib" |
---|
39 | |
---|
40 | table.insert(package.config["DebugDLL"].defines, dll_defines) |
---|
41 | table.insert(package.config["ReleaseDLL"].defines, dll_defines) |
---|
42 | table.insert(package.config["DebugLib"].defines, lib_defines) |
---|
43 | table.insert(package.config["ReleaseLib"].defines, lib_defines) |
---|
44 | end |
---|
45 | |
---|
46 | package.includepaths = |
---|
47 | { |
---|
48 | "../../include" |
---|
49 | } |
---|
50 | |
---|
51 | -- disable VS2005 CRT security warnings |
---|
52 | if (options["target"] == "vs2005") then |
---|
53 | table.insert(package.defines, "_CRT_SECURE_NO_DEPRECATE") |
---|
54 | end |
---|
55 | |
---|
56 | |
---|
57 | -- Build Flags |
---|
58 | |
---|
59 | package.config["DebugLib"].buildflags = { } |
---|
60 | package.config["DebugDLL"].buildflags = { } |
---|
61 | |
---|
62 | package.config["ReleaseDLL"].buildflags = { "optimize-speed", "no-symbols", "no-frame-pointer" } |
---|
63 | package.config["ReleaseLib"].buildflags = { "optimize-speed", "no-symbols", "no-frame-pointer" } |
---|
64 | |
---|
65 | if (options.target == "vs6" or options.target == "vs2002" or options.target == "vs2003") then |
---|
66 | table.insert(package.config.DebugLib.buildflags, "static-runtime") |
---|
67 | table.insert(package.config.ReleaseLib.buildflags, "static-runtime") |
---|
68 | end |
---|
69 | |
---|
70 | |
---|
71 | -- Libraries |
---|
72 | |
---|
73 | local windows_libs = |
---|
74 | { |
---|
75 | "user32", |
---|
76 | "opengl32", |
---|
77 | "glu32", |
---|
78 | "winmm", |
---|
79 | "gdi32" |
---|
80 | } |
---|
81 | |
---|
82 | local x11_libs = |
---|
83 | { |
---|
84 | "X11", |
---|
85 | "GL", |
---|
86 | "GLU" |
---|
87 | } |
---|
88 | |
---|
89 | if (windows) then |
---|
90 | table.insert(package.links, windows_libs) |
---|
91 | else |
---|
92 | table.insert(package.links, x11_libs) |
---|
93 | end |
---|
94 | |
---|
95 | |
---|
96 | -- Files |
---|
97 | |
---|
98 | package.files = |
---|
99 | { |
---|
100 | matchfiles("../../include/drawstuff/*.h"), |
---|
101 | "../../drawstuff/src/internal.h", |
---|
102 | "../../drawstuff/src/drawstuff.cpp" |
---|
103 | } |
---|
104 | |
---|
105 | if (windows) then |
---|
106 | table.insert(package.defines, "WIN32") |
---|
107 | table.insert(package.files, "../../drawstuff/src/resource.h") |
---|
108 | table.insert(package.files, "../../drawstuff/src/resources.rc") |
---|
109 | table.insert(package.files, "../../drawstuff/src/windows.cpp") |
---|
110 | else |
---|
111 | table.insert(package.files, "../../drawstuff/src/x11.cpp") |
---|
112 | end |
---|