-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMBuilder
27 lines (21 loc) · 939 Bytes
/
AMBuilder
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
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
compiler = SM.DefaultExtCompiler('extensions/regex')
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
extension = AMBuild.AddJob('regex.ext')
binary = Cpp.LibraryBuilder('regex.ext', AMBuild, extension, compiler)
if AMBuild.target['platform'] == 'linux':
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
elif AMBuild.target['platform'] == 'windows':
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_win', 'pcre.lib')
elif AMBuild.target['platform'] == 'darwin':
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
binary.RelinkIfNewer(path)
binary['POSTLINKFLAGS'].append(path)
binary.AddSourceFiles('extensions/regex', [
'extension.cpp',
'CRegEx.cpp',
'sdk/smsdk_ext.cpp',
])
SM.AutoVersion('extensions/regex', binary)
binary.SendToJob()