def METHOD_NAME(self, ext: CMakeExtension) -> None:
    self.announce("Building native extension...")
    # Pass the platform architecture for arm64 to cmake for
    # cross-compilation.
    env_vars = os.environ.copy()
    python_version = '.'.join(
        (str(sys.version_info.major),  str(sys.version_info.minor)))
    self.announce("Python version is %s" % python_version)
    env_vars['PYBIND11_PYTHON_VERSION'] = python_version
    env_vars['PYTHON_EXECUTABLE'] = sys.executable
    if sys.platform == 'darwin':
        archflags = os.getenv("ARCHFLAGS", "")
        if len(archflags) > 0:
            self.announce("The ARCHFLAGS is set to '%s'." %
                          archflags)
            if archflags == "-arch arm64":
                env_vars['CMAKE_OSX_ARCHITECTURES'] = "arm64"
            elif archflags == "-arch x86_64":
                env_vars['CMAKE_OSX_ARCHITECTURES'] = "x86_64"
            else:
                self.announce(
                    "The ARCHFLAGS is not valid and will be ignored.")
        else:
            self.announce("The ARCHFLAGS is not set.")
        deploy_target = os.getenv("MACOSX_DEPLOYMENT_TARGET", "")
        if len(deploy_target) > 0:
            self.announce("The deployment target is set to '%s'." %
                          deploy_target)
            env_vars['CMAKE_OSX_DEPLOYMENT_TARGET'] = deploy_target
    build_dir = os.path.join(ext.sourcedir, 'kuzu-source')
    # Clean the build directory.
    subprocess.run(['make', 'clean'], check=True, cwd=build_dir)
    # Build the native extension.
    full_cmd = ['make', 'release', 'NUM_THREADS=%d' % num_cores]
    subprocess.run(full_cmd, cwd=build_dir, check=True, env=env_vars)
    self.announce("Done building native extension.")
    self.announce("Copying native extension...")
    dst = os.path.join(ext.sourcedir, ext.name)
    shutil.rmtree(dst, ignore_errors=True)
    shutil.copytree(os.path.join(build_dir, 'tools', 'python_api', 'build',
                                 ext.name), dst)
    self.announce("Done copying native extension.")