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) == 2 |
634 635 name = str(source[0].get_contents()) |
636 use_python = source[1].read() |
637 obj = all_enums[name] 638 639 code = code_formatter() 640 obj.cxx_def(code) |
641 if use_python: |
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) |
736 env.Command(cc_file, [Value(name), Value(env['USE_PYTHON'])], |
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 --- |