core/logic/AMBuilder
author Kyle Sanderson <kyle.leet@gmail.com>
Mon Aug 12 00:42:56 2013 +0100 (2013-08-12)
changeset 3994 4bc73bac0f4c
parent 3872 4c93f74cae51
child 4025 542dde661d5c
permissions -rw-r--r--
Added helper stock to check if a command exists. (bug 5510, r=asherkin)
     1 # vim: set ts=2 sw=2 tw=99 noet ft=python: 
     2 import os
     3 
     4 compiler = SM.DefaultCompiler()
     5 base = AMBuild.sourceFolder
     6 compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
     7 compiler['CXXINCLUDES'].append(os.path.join(base, 'core', 'logic'))
     8 compiler['CXXINCLUDES'].append(os.path.join(base, 'public'))
     9 compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'sourcepawn'))
    10 compiler['CDEFINES'].append('SM_DEFAULT_THREADER')
    11 compiler['CDEFINES'].append('SM_LOGIC')
    12 
    13 if AMBuild.target['platform'] == 'linux':
    14 	compiler['POSTLINKFLAGS'].append('-lpthread')
    15 if AMBuild.target['platform'] == 'darwin':
    16 	compiler['CFLAGS'].extend(['-Wno-deprecated-declarations'])
    17 	compiler['POSTLINKFLAGS'].extend(['-framework', 'CoreServices'])
    18 
    19 extension = AMBuild.AddJob('sourcemod.logic')
    20 binary = Cpp.LibraryBuilder('sourcemod.logic', AMBuild, extension, compiler)
    21 files = [
    22 	'common_logic.cpp',
    23 	'smn_adt_array.cpp',
    24 	'smn_sorting.cpp',
    25 	'smn_maplists.cpp',
    26 	'smn_adt_stack.cpp',
    27 	'thread/ThreadWorker.cpp',
    28 	'thread/BaseWorker.cpp',
    29 	'ThreadSupport.cpp',
    30 	'smn_float.cpp',
    31 	'TextParsers.cpp',
    32 	'smn_textparse.cpp',
    33 	'smn_adt_trie.cpp',
    34 	'Profiler.cpp',
    35 	'smn_functions.cpp',
    36 	'smn_timers.cpp',
    37 	'smn_players.cpp',
    38 	'MemoryUtils.cpp',
    39 	'smn_admin.cpp',
    40 	'smn_banning.cpp',
    41 	'smn_filesystem.cpp',
    42 	'stringutil.cpp',
    43 	'Translator.cpp',
    44 	'PhraseCollection.cpp',
    45 	'smn_lang.cpp',
    46 	'smn_string.cpp',
    47 	'smn_handles.cpp',
    48 	'smn_datapacks.cpp',
    49 	'smn_gameconfigs.cpp',
    50 	'smn_fakenatives.cpp',
    51 	'GameConfigs.cpp',
    52 	'sm_crc32.cpp',
    53 	'smn_profiler.cpp',
    54 	'ShareSys.cpp',
    55 	'PluginSys.cpp',
    56 	'HandleSys.cpp',
    57 	'NativeOwner.cpp',
    58 	'NativeInvoker.cpp',
    59 	'ExtensionSys.cpp',
    60 	'DebugReporter.cpp'
    61 	]
    62 if AMBuild.target['platform'] == 'windows':
    63 	files.append('thread/WinThreads.cpp')
    64 else:
    65 	files.append('thread/PosixThreads.cpp')
    66 binary.AddSourceFiles('core/logic', files)
    67 SM.AutoVersion('core/logic', binary)
    68 SM.ExtractDebugInfo(extension, binary)
    69 binary.SendToJob()
    70