diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-04 22:54:22 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-04 22:54:22 +0000 |
commit | f93616a43119066d1bdfda36ddf174084c351f49 (patch) | |
tree | 79acfbdb346a0e70cc5d4ebb3e836109635a9871 /ppapi/generators | |
parent | 7863d80ad15005d30eed616030be96b0dbebce8b (diff) | |
download | chromium_src-f93616a43119066d1bdfda36ddf174084c351f49.zip chromium_src-f93616a43119066d1bdfda36ddf174084c351f49.tar.gz chromium_src-f93616a43119066d1bdfda36ddf174084c351f49.tar.bz2 |
Fix IDL generation on Windows. The output file paths were wrong because
of mixing POSIX and Windows style path separators.
BUG=none
TEST=manual
Review URL: http://codereview.chromium.org/8136013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators')
-rw-r--r-- | ppapi/generators/idl_c_header.py | 16 | ||||
-rw-r--r-- | ppapi/generators/idl_parser.py | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py index df21c20..7145a91 100644 --- a/ppapi/generators/idl_c_header.py +++ b/ppapi/generators/idl_c_header.py @@ -20,8 +20,8 @@ from idl_parser import ParseFiles from idl_c_proto import CGen, GetNodeComments, CommentLines, Comment from idl_generator import Generator, GeneratorByFile -Option('dstroot', 'Base directory of output', default='../c') -Option('guard', 'Include guard prefix', default='ppapi/c') +Option('dstroot', 'Base directory of output', default=os.path.join('..', 'c')) +Option('guard', 'Include guard prefix', default=os.path.join('ppapi', 'c')) Option('out', 'List of output files', default='') def GetOutFileName(filenode, relpath=None, prefix=None): @@ -135,7 +135,7 @@ class HGen(GeneratorByFile): gpath = GetOption('guard') release = releases[0] def_guard = GetOutFileName(filenode, relpath=gpath) - def_guard = def_guard.replace('/','_').replace('.','_').upper() + '_' + def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' cright_node = filenode.GetChildren()[0] assert(cright_node.IsA('Copyright')) @@ -144,7 +144,8 @@ class HGen(GeneratorByFile): out.Write('%s\n' % cgen.Copyright(cright_node)) out.Write('/* From %s modified %s. */\n\n'% ( - filenode.GetProperty('NAME'), filenode.GetProperty('DATETIME'))) + filenode.GetProperty('NAME').replace(os.sep,'/'), + filenode.GetProperty('DATETIME'))) out.Write('#ifndef %s\n#define %s\n\n' % (def_guard, def_guard)) # Generate set of includes @@ -157,7 +158,8 @@ class HGen(GeneratorByFile): depfile = dep.GetProperty('FILE') if depfile: includes.add(depfile) - includes = [GetOutFileName(include, relpath=gpath) for include in includes] + includes = [GetOutFileName( + include, relpath=gpath).replace(os.sep, '/') for include in includes] includes.append('ppapi/c/pp_macros.h') # Assume we need stdint if we "include" C or C++ code @@ -165,7 +167,7 @@ class HGen(GeneratorByFile): includes.append('ppapi/c/pp_stdint.h') includes = sorted(set(includes)) - cur_include = GetOutFileName(filenode, relpath=gpath) + cur_include = GetOutFileName(filenode, relpath=gpath).replace(os.sep, '/') for include in includes: if include == cur_include: continue out.Write('#include "%s"\n' % include) @@ -197,7 +199,7 @@ class HGen(GeneratorByFile): def GenerateTail(self, out, filenode, releases, options): gpath = GetOption('guard') def_guard = GetOutFileName(filenode, relpath=gpath) - def_guard = def_guard.replace('/','_').replace('.','_').upper() + '_' + def_guard = def_guard.replace(os.sep,'_').replace('.','_').upper() + '_' out.Write('#endif /* %s */\n\n' % def_guard) diff --git a/ppapi/generators/idl_parser.py b/ppapi/generators/idl_parser.py index c04d261..fea256c 100644 --- a/ppapi/generators/idl_parser.py +++ b/ppapi/generators/idl_parser.py @@ -44,7 +44,7 @@ Option('build_debug', 'Debug tree building.') Option('parse_debug', 'Debug parse reduction steps.') Option('token_debug', 'Debug token generation.') Option('dump_tree', 'Dump the tree.') -Option('srcroot', 'Working directory.', default='../api') +Option('srcroot', 'Working directory.', default=os.path.join('..', 'api')) # # ERROR_REMAP |