SConstruct
branchpyrit
changeset 64 5785cca4cdb9
parent 63 440e1ae80459
child 65 242839c6d27d
equal deleted inserted replaced
63:440e1ae80459 64:5785cca4cdb9
       
     1 Help("""
       
     2 Targets:
       
     3     all              - build everything,
       
     4 
       
     5     libs             - build all libraries
       
     6     demos            - build all demos
       
     7     models           - download/prepare all models
       
     8     docs             - compile doxygen documentation
       
     9 
       
    10     libs = (static-lib, python-module)
       
    11     static-lib       - ray tracer library to link with
       
    12     python-module    - ray tracer module for Python
       
    13 
       
    14     demos = (python-demos, cc-demos)
       
    15     python-demos     - Python demos, this depends on python-module
       
    16     cc-demos         - C++ demos
       
    17 
       
    18     models = (local-models, download-models)
       
    19     local-models     - prepare local models
       
    20     download-models  - download models which are not locally available
       
    21 
       
    22     no-docs = (libs, demos, models)
       
    23                      - everything but docs
       
    24     no-download = (libs, demos, local-models)
       
    25                      - everything but docs and downloadable models
       
    26 
       
    27 Default target is no-download.
       
    28 """)
       
    29 
     1 Decider('MD5-timestamp')
    30 Decider('MD5-timestamp')
     2 import os
    31 import os
     3 env = Environment(ENV = {'PATH' : os.environ['PATH']})
    32 env = Environment(ENV = {'PATH' : os.environ['PATH']})
     4 
    33 
     5 ### GNU C++ Compiler
    34 ### GNU C++ Compiler
     9 ### Intel C++ Compiler
    38 ### Intel C++ Compiler
    10 env.Replace(CXX="icpc")
    39 env.Replace(CXX="icpc")
    11 env.Append(CCFLAGS="-O3 -w1 -mtune=core2 -xT ")
    40 env.Append(CCFLAGS="-O3 -w1 -mtune=core2 -xT ")
    12 
    41 
    13 ### MinGW32
    42 ### MinGW32
    14 #  LDFLAGS+=-lpthreadGC2
       
    15 #  PY_CCFLAGS=-I"C:\Program Files\Python25\include"
    43 #  PY_CCFLAGS=-I"C:\Program Files\Python25\include"
    16 #  PY_LDFLAGS=-L"C:\Program Files\Python25\libs" -lpython25
    44 #  PY_LDFLAGS=-L"C:\Program Files\Python25\libs" -lpython25
    17 
    45 
    18 # pthread
    46 # pthread
    19 env.Append(CCFLAGS="-pthread ")
    47 if env['PLATFORM'] == 'win32':
       
    48 	env.Append(LINKFLAGS="-lpthreadGC2 ")
       
    49 else:
       
    50 	env.Append(CCFLAGS="-pthread ")
    20 
    51 
    21 # CCFLAGS=-g -fno-strict-aliasing
    52 # CCFLAGS=-g -fno-strict-aliasing
    22 
    53 
    23 # float: -fsingle-precision-constant
    54 # float: -fsingle-precision-constant
    24 # double: -DPYRIT_DOUBLE
    55 # double: -DPYRIT_DOUBLE
    31 SConscript('models/SConscript')
    62 SConscript('models/SConscript')
    32 
    63 
    33 env.Alias('docs', Command('docs/html', [], 'doxygen'))
    64 env.Alias('docs', Command('docs/html', [], 'doxygen'))
    34 env.Clean('docs', ['docs/html', 'docs/latex'])
    65 env.Clean('docs', ['docs/html', 'docs/latex'])
    35 
    66 
    36 env.Alias('all', ['no-docs', 'docs'])
       
    37 env.Alias('no-docs', ['libs', 'demos', 'models'])
    67 env.Alias('no-docs', ['libs', 'demos', 'models'])
    38 env.Alias('no-download', ['libs', 'demos', 'local-models'])
    68 env.Alias('no-download', ['libs', 'demos', 'local-models'])
    39 
    69 
       
    70 env.Alias('all', ['no-docs', 'docs'])
       
    71 
    40 env.Alias('pyrit', 'no-download')
    72 env.Alias('pyrit', 'no-download')
    41 Default('pyrit')
    73 Default('pyrit')