Example #1
0
def run_task_install():
    f.debug("Installing libraries...")

    # configs
    for config in c.configurations_ios:
        f.remove_dir(os.path.join("build", "ios", config))
        f.create_dir(os.path.join("build", "ios", config))
        f.create_dir(os.path.join("build", "ios", config, "lib"))

        # targets
        for target in c.targets_ios:
            source_lib_path = os.path.join(
                "build",
                target["target_os"],
                "pdfium",
                "out",
                "{0}-{1}-{2}".format(target["target_os"], target["target_cpu"],
                                     config),
                "obj",
                "libpdfium.a",
            )

            target_lib_path = os.path.join(
                "build",
                target["target_os"],
                config,
                "lib",
                "libpdfium_{0}.a".format(target["target_cpu"]),
            )

            f.copy_file(source_lib_path, target_lib_path)

        # universal
        folder = os.path.join("build", "ios", config, "lib", "*.a")
        files = glob.glob(folder)
        files_str = " ".join(files)
        lib_file_out = os.path.join("build", "ios", config, "lib",
                                    "libpdfium.a")

        f.debug("Merging libraries (lipo)...")
        command = " ".join(["lipo", "-create", files_str, "-o", lib_file_out])
        check_call(command, shell=True)

        f.debug("File data...")
        command = " ".join(["file", lib_file_out])
        check_call(command, shell=True)

        f.debug("File size...")
        command = " ".join(["ls", "-lh ", lib_file_out])
        check_call(command, shell=True)

        # include
        include_dir = os.path.join("build", "ios", "pdfium", "public")
        target_include_dir = os.path.join("build", "ios", config, "include")
        f.remove_dir(target_include_dir)
        f.create_dir(target_include_dir)

        for basename in os.listdir(include_dir):
            if basename.endswith(".h"):
                pathname = os.path.join(include_dir, basename)

                if os.path.isfile(pathname):
                    f.copy_file2(pathname, target_include_dir)
Example #2
0
def run_task_install():
    f.debug("Installing libraries...")

    # configs
    for config in c.configurations_wasm:
        for target in c.targets_wasm:
            f.remove_dir(
                os.path.join("build", target["target_os"],
                             target["target_cpu"], config))

            f.create_dir(
                os.path.join("build", target["target_os"],
                             target["target_cpu"], config))

            f.create_dir(
                os.path.join("build", target["target_os"],
                             target["target_cpu"], config, "lib"))

            source_lib_path = os.path.join(
                "build",
                target["target_os"],
                "pdfium",
                "out",
                "{0}-{1}-{2}".format(target["target_os"], target["target_cpu"],
                                     config),
                "obj",
                "libpdfium.a",
            )

            target_lib_path = os.path.join(
                "build",
                target["target_os"],
                target["target_cpu"],
                config,
                "lib",
                "libpdfium.a",
            )

            f.copy_file(source_lib_path, target_lib_path)

            # check file
            f.debug("File data...")
            command = " ".join(["file", target_lib_path])
            check_call(command, shell=True)

            f.debug("File size...")
            command = " ".join(["ls", "-lh ", target_lib_path])
            check_call(command, shell=True)

            # include
            include_dir = os.path.join("build", "linux", "pdfium", "public")
            target_include_dir = os.path.join("build", target["target_os"],
                                              target["target_cpu"], config,
                                              "include")

            f.remove_dir(target_include_dir)
            f.create_dir(target_include_dir)

            for basename in os.listdir(include_dir):
                if basename.endswith(".h"):
                    pathname = os.path.join(include_dir, basename)

                    if os.path.isfile(pathname):
                        f.copy_file2(pathname, target_include_dir)