summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/idl/idl_filenames.py
blob: ceb15754add05f5e6b308278a99acfd550dd0220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

# This script takes a list of inputs and generates a list of outputs
# that Nixysa will generate.  It passes through any files not ending
# in .idl, and converts idl files into corresponding .cc and .h files.

# The first argument is the destintation directory for the output
# files, and the rest are relative paths to the source files.  The
# output is posix paths, because that's what GYP expects.

import sys
import posixpath

output_dir = sys.argv[1]

for file in sys.argv[2:]:
  (base, suffix) = posixpath.splitext(file)
  if suffix == ".idl":
    print posixpath.normpath(posixpath.join(output_dir, "%s_glue.h" % base))
    print posixpath.normpath(posixpath.join(output_dir, "%s_glue.cc" % base))
  else:
    print posixpath.normpath(posixpath.join(output_dir, file))

sys.exit(0)