Ejemplo n.º 1
0
def addPackageToWasmModule(packageName, currModule, addSourceFiles):
    for dirpath, dirnames, filenames in os.walk(
            os.path.join("/occt/occt-628c021/src/", packageName)):
        for item in filenames:
            if filterIncludeFile(item):
                currModule.addHeaderFile(str(os.path.join(dirpath, item)))
            if filterSourceFile(item) and addSourceFiles:
                currModule.addSourceFile(str(os.path.join(dirpath, item)))
Ejemplo n.º 2
0
def getPackageIncludes(packageName):
  includeFiles = set()
  packageDir = "/occt/occt-628c021/src/" + packageName
  for dirpath, dirnames, filenames in os.walk(packageDir):
    for item in filenames:
      if filterIncludeFile(item):
        includeFiles.add(str(os.path.join(dirpath, item)))
  return includeFiles
Ejemplo n.º 3
0
def getGlobalIncludes() -> Set[str]:
    includeFiles = list()
    additionalIncludePaths = list()
    for dirpath, dirnames, filenames in os.walk(occtBasePath):
        additionalIncludePaths.append(str(dirpath))
        for item in filenames:
            if filterIncludeFile(item):
                includeFiles.append(str(os.path.join(dirpath, item)))
    return [includeFiles, additionalIncludePaths]
Ejemplo n.º 4
0
def getPackageIncludes(packageName):
    includeFiles = set()
    packageDir = "/occt/occt-" + os.environ[
        'OCCT_COMMIT_HASH'] + "/src/" + packageName
    for dirpath, dirnames, filenames in os.walk(packageDir):
        for item in filenames:
            if filterIncludeFile(item):
                includeFiles.add(str(os.path.join(dirpath, item)))
    return includeFiles
Ejemplo n.º 5
0
def getGlobalIncludes():
  includeFiles = set()
  additionalIncludePaths = set()
  for dirpath, dirnames, filenames in os.walk("/occt/occt-628c021/src/"):
    additionalIncludePaths.add(str(dirpath))
    for item in filenames:
      if filterIncludeFile(item):
        includeFiles.add(str(os.path.join(dirpath, item)))
  return [includeFiles, additionalIncludePaths]
Ejemplo n.º 6
0
def getGlobalIncludes():
    includeFiles = set()
    additionalIncludePaths = set()
    for dirpath, dirnames, filenames in os.walk(
            "/occt/occt-" + os.environ['OCCT_COMMIT_HASH'] + "/src/"):
        additionalIncludePaths.add(str(dirpath))
        for item in filenames:
            if filterIncludeFile(item):
                includeFiles.add(str(os.path.join(dirpath, item)))
    return [includeFiles, additionalIncludePaths]
Ejemplo n.º 7
0
        "/freetype/include",
    ])

    print("Built module " + aModule.name)


def chunks(lst, n):
    """Yield successive n-sized chunks from lst."""
    for i in range(0, len(lst), n):
        yield lst[i:i + n]


for dirpath, dirnames, filenames in os.walk("/occt/occt-628c021/src/"):
    includePaths.append(str(dirpath))
    for item in filenames:
        if filterIncludeFile(item):
            includeFiles.append(str(os.path.join(dirpath, item)))

preproc = WasmModule()
for dirpath, dirnames, filenames in os.walk("/occt/occt-628c021/src/"):
    moduleName = os.path.basename(dirpath)
    if moduleName == "":
        continue

    if not any(x for x in filenames if x == "PACKAGES"):
        continue

    with open(dirpath + "/PACKAGES", "r") as a_file:
        for line in a_file:
            addPackageToWasmModule(line.strip(), preproc, False)
preproc.parse(