comparison src/liblo-0.26/build/premake4.lua @ 4:e13257ea84a4

Add bzip2, zlib, liblo, portaudio sources
author Chris Cannam
date Wed, 20 Mar 2013 13:59:52 +0000
parents
children
comparison
equal deleted inserted replaced
3:6c505a35919a 4:e13257ea84a4
1 ----------------------------------------------------------------------
2 -- Premake4 configuration script for LibLo
3 -- Adapted from ODE's build script by Jason Perkins.
4 -- For more information on Premake: http://industriousone.com/premake
5 ----------------------------------------------------------------------
6
7 ----------------------------------------------------------------------
8 -- Configuration options
9 ----------------------------------------------------------------------
10
11 -- always clean all of the optional components and toolsets
12 if _ACTION == "clean" then
13 for action in pairs(premake.actions) do
14 os.rmdir(action)
15 end
16 end
17
18
19
20 ----------------------------------------------------------------------
21 -- The solution, and solution-wide settings
22 ----------------------------------------------------------------------
23
24 solution "liblo"
25
26 language "C"
27 location ( _OPTIONS["to"] or _ACTION )
28
29 includedirs {
30 "../lo",
31 "../src"
32 }
33
34 -- define all the possible build configurations
35 configurations {
36 "DebugDLL", "ReleaseDLL",
37 "DebugLib", "ReleaseLib",
38 }
39
40 configuration { "Debug*" }
41 defines { "_DEBUG" }
42 flags { "Symbols" }
43
44 configuration { "Release*" }
45 flags { "OptimizeSpeed", "NoFramePointer" }
46
47 configuration { "Windows" }
48 defines { "WIN32" }
49
50 -- give each configuration a unique output directory
51 for _, name in ipairs(configurations()) do
52 configuration { name }
53 targetdir ( "../lib/" .. name )
54 end
55
56 -- disable Visual Studio security warnings
57 configuration { "vs*" }
58 defines { "_CRT_SECURE_NO_DEPRECATE" }
59
60 -- tell source to use config.h
61 configuration { "vs*" }
62 defines { "HAVE_CONFIG_H" }
63
64 -- don't remember why we had to do this (from ODE)
65 configuration { "vs2002 or vs2003", "*Lib" }
66 flags { "StaticRuntime" }
67
68 ----------------------------------------------------------------------
69 -- Write a custom <config.h> to .., based on the supplied flags
70 ----------------------------------------------------------------------
71
72 -- First get the version number from "configure.ac" --
73
74 io.input("../configure.ac")
75 text = io.read("*all")
76 io.close()
77 text = string.sub(text,string.find(text, "AC_INIT.+"))
78 version = string.sub(text,string.find(text, "%d+%.%d+"))
79
80 -- Replace it in "config.h" --
81
82 io.input("config-msvc.h")
83 local text = io.read("*all")
84
85 text = string.gsub(text, '/%*VERSION%*/', '"'..version..'"')
86
87 io.output("../config.h")
88 io.write(text)
89 io.close()
90
91 ----------------------------------------------------------------------
92 -- Copy <lo_endian.h> to ../lo
93 ----------------------------------------------------------------------
94
95 io.input("lo_endian-msvc.h")
96 io.output("../lo/lo_endian.h")
97 local text = io.read("*all")
98 io.write(text)
99 io.close()
100
101 ----------------------------------------------------------------------
102 -- The LibLo library project
103 ----------------------------------------------------------------------
104
105 project "liblo"
106
107 kind "StaticLib"
108 location ( _OPTIONS["to"] or _ACTION )
109
110 includedirs {
111 "..",
112 }
113
114 files {
115 "../src/*.c",
116 "../src/*.h",
117 "../lo/*.h",
118 "../src/liblo.def",
119 }
120
121 excludes {
122 "../src/testlo.c",
123 "../src/subtest.c",
124 "../src/tools",
125 }
126
127 configuration { "windows" }
128 links { "user32",
129 "wsock32",
130 "ws2_32",
131 "pthreadVC2",
132 }
133
134 configuration { "*Lib" }
135 kind "StaticLib"
136 defines "LIBLO_LIB"
137
138 configuration { "*DLL" }
139 kind "SharedLib"
140 defines "LIBLO_DLL"
141
142 configuration { "Debug*" }
143 targetname "liblo_d"
144
145 configuration { "Release*" }
146 targetname "liblo"
147
148
149 ----------------------------------------------------------------------
150 -- The automated test application
151 ----------------------------------------------------------------------
152
153
154 project "testlo"
155
156 kind "ConsoleApp"
157 location ( _OPTIONS["to"] or _ACTION )
158 links { "user32",
159 "wsock32",
160 "ws2_32",
161 "pthreadVC2",
162 }
163
164 includedirs {
165 "..",
166 }
167
168 files {
169 "../src/testlo.c",
170 }
171
172 configuration { "DebugDLL" }
173 links { "liblo_d" }
174 libdirs { "../lib/debugdll" }
175
176 configuration { "DebugLib" }
177 links { "liblo_d" }
178 libdirs { "../lib/debuglib" }
179
180 configuration { "Release*" }
181 links { "liblo" }
182
183 project "subtest"
184
185 kind "ConsoleApp"
186 location ( _OPTIONS["to"] or _ACTION )
187 links { "user32",
188 "wsock32",
189 "ws2_32",
190 "pthreadVC2",
191 }
192
193 includedirs {
194 "..",
195 }
196
197 files {
198 "../src/subtest.c",
199 }
200
201 configuration { "DebugDLL" }
202 links { "liblo_d" }
203 libdirs { "../lib/debugdll" }
204
205 configuration { "DebugLib" }
206 links { "liblo_d" }
207 libdirs { "../lib/debuglib" }
208
209 configuration { "Release*" }
210 links { "liblo" }