Advertisement
Guest User

SConstruct

a guest
Nov 2nd, 2014
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.35 KB | None | 0 0
  1. # -*- Mode: python -*-
  2.  
  3. import os, platform, subprocess
  4.  
  5. ( system, node, release, version, machine, processor ) = platform.uname()
  6.  
  7. env = Environment( ENV = os.environ )
  8.  
  9. if ( system == 'Darwin' ):
  10.     env['SDL2_CONFIG'] = '/Users/timo/SDL/autocrap.install/bin/sdl2-config'
  11.     env['OGRE_SRC'] = '/Users/timo/ogre'
  12.     env['MACPORTS_PREFIX'] = '/opt/local'
  13. else:
  14.     env['SDL2_CONFIG'] = '/usr/bin/sdl2-config'
  15.     env['OGRE_SRC'] = '/home/vic/ogre'
  16.  
  17. env.Append( CCFLAGS = [ '-g', '-lboost_system', ] )
  18.  
  19. env.ParseConfig( '%s --cflags --libs' % env['SDL2_CONFIG'] )
  20.  
  21. env.Append( CPPPATH = os.path.join( env['OGRE_SRC'], 'include' ) )
  22. env.Append( CPPPATH = os.path.join( env['OGRE_SRC'], 'OgreMain/include' ) )
  23. env.Append( CPPPATH = os.path.join( env['OGRE_SRC'], 'PlugIns/BSPSceneManager/include' ) )
  24.  
  25. source = [ 'main.cpp', 'render_main.cpp', 'game_main.cpp' ]
  26.  
  27.  
  28. if ( system == 'Darwin' ):
  29.     env.Append( CCFLAGS = ['-arch', 'x86_64', ] )
  30.     env.Append( CPPPATH = os.path.join( env['OGRE_SRC'], 'RenderSystems/GL/include' ) )
  31.     env.Append( CPPPATH = os.path.join( env['OGRE_SRC'], 'RenderSystems/GL/include/OSX' ) )
  32.     env.Append( CPPPATH = os.path.join( env['MACPORTS_PREFIX'], 'include' ) ) # boost, zmq etc.
  33.     env.Append( FRAMEWORKPATH = os.path.join( env['OGRE_SRC'], 'lib/Release' ) )
  34.     env.Append( FRAMEWORKS = [ 'Ogre', 'Foundation', 'AppKit' ] )
  35.     env.Append( LIBS = [ 'czmq', 'zmq', ] )
  36.     env.Append( LIBPATH = os.path.join( env['MACPORTS_PREFIX'], 'lib' ) )
  37.     env.Append( LINKFLAGS = [ '-headerpad_max_install_names', ] )
  38.     source.append( 'OSX_wrap.mm' )
  39. else:
  40.     env.Append( LIBS = 'OgreMain' )
  41.     env.Append( RPATH = [ os.path.join( env['OGRE_SRC'], 'lib' ) ] )
  42.     env.Append( LIBPATH = os.path.join( env['OGRE_SRC'], 'lib' ) )
  43.     env.ParseConfig( 'pkg-config libzmq --cflags --libs' )
  44.     env.ParseConfig( 'pkg-config libczmq --cflags --libs' )
  45.     env.Append( RPATH = [ '/usr/local/lib' ] )
  46.     env.Append( RPATH = [ '.' ] )
  47.  
  48.  
  49. # see site_scons/site_init.py
  50. env = AppendOSXBundleBuilder( env )
  51.  
  52.  
  53. template_env = env.Clone()
  54. template_env.Append( CPPPATH = [ 'template_src' ] )
  55. template_env.VariantDir( 'build/template_src', '.' )
  56. template = template_env.Program( 'template', [ os.path.join( 'build/template_src', s ) for s in source + [ 'template_src/game.cpp', 'template_src/render.cpp' ] ] )
  57. template_bundle = template_env.Bundle( Dir( 'template.app' ), template )
  58.  
  59. scene_env = env.Clone()
  60. scene_env.Append( CPPPATH = [ 'scene_load_src' ] )
  61. scene_env.VariantDir( 'build/scene_load_src', '.' )
  62. scene = scene_env.Program( 'scene', [ os.path.join( 'build/scene_load_src', s ) for s in source + [ 'scene_load_src/game.cpp', 'scene_load_src/render.cpp' ] ] )
  63. scene_bundle = scene_env.Bundle( Dir( 'scene.app' ), scene )
  64.  
  65. head_env = env.Clone()
  66. head_env.Append( CPPPATH = [ 'head_src' ] )
  67. head_env.VariantDir( 'build/head_src', '.' )
  68. head = head_env.Program( 'head', [ os.path.join( 'build/head_src', s ) for s in source + [ 'head_src/game.cpp', 'head_src/render.cpp' ] ] )
  69. head_bundle = head_env.Bundle( Dir( 'head.app' ), head )
  70.  
  71. bsp_env = env.Clone()
  72. bsp_env.Append( CPPPATH = [ 'bsp_src' ] )
  73. bsp_env.VariantDir( 'build/bsp_src', '.' )
  74. bsp = bsp_env.Program( 'bsp', [ os.path.join( 'build/bsp_src', s ) for s in source + [ 'bsp_src/game.cpp', 'bsp_src/render.cpp' ] ] )
  75. bsp_bundle = bsp_env.Bundle( Dir( 'bsp.app' ), bsp )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement