Mercurial > hg > aimc
comparison trunk/SConstruct @ 324:6130fe7f6409
- Windows build fixes
author | tomwalters |
---|---|
date | Thu, 22 Jul 2010 01:19:52 +0000 |
parents | 0f54006e91ea |
children | 0a8e7d0c70dc |
comparison
equal
deleted
inserted
replaced
323:0f54006e91ea | 324:6130fe7f6409 |
---|---|
25 | 25 |
26 """ | 26 """ |
27 | 27 |
28 import os | 28 import os |
29 import shutil | 29 import shutil |
30 | |
31 # Location of libsndfile on Windows | |
32 windows_libsndfile_location = "C:\\Program Files\\Mega-Nerd\\libsndfile\\" | |
30 | 33 |
31 # Sources common to every version | 34 # Sources common to every version |
32 common_sources = ['Support/Common.cc', | 35 common_sources = ['Support/Common.cc', |
33 'Support/FileList.cc', | 36 'Support/FileList.cc', |
34 'Support/SignalBank.cc', | 37 'Support/SignalBank.cc', |
151 env.Append(CPPPATH = ['#src']) | 154 env.Append(CPPPATH = ['#src']) |
152 | 155 |
153 # Dependencies | 156 # Dependencies |
154 deplibs = ['sndfile'] | 157 deplibs = ['sndfile'] |
155 | 158 |
156 for depname in deplibs: | 159 if target_platform != 'win32': |
157 env.ParseConfig('pkg-config --cflags --libs ' + depname) | 160 for depname in deplibs: |
158 | 161 env.ParseConfig('pkg-config --cflags --libs ' + depname) |
159 env.AppendUnique(LIBS = deplibs) | 162 env.AppendUnique(LIBS = deplibs) |
163 else: | |
164 #env.AppendUnique(LIBS = ['wsock32', 'winmm']) | |
165 if 'sndfile' in deplibs: | |
166 ###### libsndfile ######################################## | |
167 # This one is only valid for win32 and already precompiled | |
168 # Only need to create .lib file from .def | |
169 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.dll', | |
170 build_dir+'/libsndfile-1.dll') | |
171 if compiler=='msvc': | |
172 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.def', | |
173 build_dir+'/libsndfile-1.def') | |
174 env.Command(build_dir + '/libsndfile.lib', build_dir + '/libsndfile.def', | |
175 env['AR'] + ' /nologo /machine:i386 /def:$SOURCE /out:$TARGET') | |
176 env.Append(CPPPATH = [windows_libsndfile_location]) | |
177 env.AppendUnique(LIBPATH = [build_dir]) | |
178 # Replace 'sndfile' with 'sndfile-1' | |
179 deplibs.remove('sndfile') | |
180 deplibs.append('sndfile-1') | |
181 | |
160 | 182 |
161 | 183 |
162 # Builder for the main program | 184 # Builder for the main program |
163 program = env.Program(target = os.path.join(build_dir, target_executable), | 185 program = env.Program(target = os.path.join(build_dir, target_executable), |
164 source = map(lambda x: '#' + build_dir + '/src/' + x, | 186 source = map(lambda x: '#' + build_dir + '/src/' + x, |