SConscript (11993:a10174523d53) SConscript (11996:b71e950a8bd0)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 616 unchanged lines hidden (view full) ---

625 obj = sim_objects[name]
626
627 code = code_formatter()
628 obj.cxx_config_param_file(code, is_header)
629 code.write(target[0].abspath)
630 return body
631
632def createEnumStrings(target, source, env):
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 616 unchanged lines hidden (view full) ---

625 obj = sim_objects[name]
626
627 code = code_formatter()
628 obj.cxx_config_param_file(code, is_header)
629 code.write(target[0].abspath)
630 return body
631
632def createEnumStrings(target, source, env):
633 assert len(target) == 1 and len(source) == 1
633 assert len(target) == 1 and len(source) == 2
634
635 name = str(source[0].get_contents())
634
635 name = str(source[0].get_contents())
636 use_python = source[1].read()
636 obj = all_enums[name]
637
638 code = code_formatter()
639 obj.cxx_def(code)
637 obj = all_enums[name]
638
639 code = code_formatter()
640 obj.cxx_def(code)
640 if env['USE_PYTHON']:
641 if use_python:
641 obj.pybind_def(code)
642 code.write(target[0].abspath)
643
644def createEnumDecls(target, source, env):
645 assert len(target) == 1 and len(source) == 1
646
647 name = str(source[0].get_contents())
648 obj = all_enums[name]

--- 78 unchanged lines hidden (view full) ---

727 Source(cxx_config_init_cc_file)
728
729# Generate all enum header files
730for name,enum in sorted(all_enums.iteritems()):
731 py_source = PySource.modules[enum.__module__]
732 extra_deps = [ py_source.tnode ]
733
734 cc_file = File('enums/%s.cc' % name)
642 obj.pybind_def(code)
643 code.write(target[0].abspath)
644
645def createEnumDecls(target, source, env):
646 assert len(target) == 1 and len(source) == 1
647
648 name = str(source[0].get_contents())
649 obj = all_enums[name]

--- 78 unchanged lines hidden (view full) ---

728 Source(cxx_config_init_cc_file)
729
730# Generate all enum header files
731for name,enum in sorted(all_enums.iteritems()):
732 py_source = PySource.modules[enum.__module__]
733 extra_deps = [ py_source.tnode ]
734
735 cc_file = File('enums/%s.cc' % name)
735 env.Command(cc_file, Value(name),
736 env.Command(cc_file, [Value(name), Value(env['USE_PYTHON'])],
736 MakeAction(createEnumStrings, Transform("ENUM STR")))
737 env.Depends(cc_file, depends + extra_deps)
738 Source(cc_file)
739
740 hh_file = File('enums/%s.hh' % name)
741 env.Command(hh_file, Value(name),
742 MakeAction(createEnumDecls, Transform("ENUMDECL")))
743 env.Depends(hh_file, depends + extra_deps)

--- 502 unchanged lines hidden ---
737 MakeAction(createEnumStrings, Transform("ENUM STR")))
738 env.Depends(cc_file, depends + extra_deps)
739 Source(cc_file)
740
741 hh_file = File('enums/%s.hh' % name)
742 env.Command(hh_file, Value(name),
743 MakeAction(createEnumDecls, Transform("ENUMDECL")))
744 env.Depends(hh_file, depends + extra_deps)

--- 502 unchanged lines hidden ---