code: def build_extension(self, ext):
      from packaging import version
  
      SOURCE_DIR = ext.sourcedir
      EXT_DIR = path.abspath(
          path.dirname(self.get_ext_fullpath(ext.name))
      )
      BUILD_TEMP = self.build_temp
  
      shutil.rmtree(BUILD_TEMP, ignore_errors=True)
      os.makedirs(BUILD_TEMP)
  
      if version.parse(self.get_cmake_version()) < version.parse(
          "3.22.0"
      ):
          cmake_passthru_flag = "--"
      else:
          cmake_passthru_flag = "-S"
  
      # Run cmake
      build_type = "Debug" if self.debug else "Release"
      if 0 != execute(
          [
              "cmake",
              "-DCMAKE_BUILD_TYPE={}".format(build_type),
              "-DCMAKE_VERBOSE_MAKEFILE={}".format(int(self.verbose)),
              "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY='{}'".format(EXT_DIR),
              # set Debug and Release paths to the output directory on Windows
              "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG='{}'".format(
                  EXT_DIR
              ),
              "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE='{}'".format(
                  EXT_DIR
              ),
              self.cmake_args or cmake_passthru_flag,
              SOURCE_DIR,
          ],
          cwd=BUILD_TEMP,
      ):
          sys.exit(
              "\nERROR: Cannot generate Makefile. See above errors."
          )
  
      # Run make
      cmd = "cmake --build ."
      # For MSVC specify build type at build time
      # https://stackoverflow.com/q/24460486/1925996
      if sys.platform.startswith("win"):
          cmd += " --config " + build_type
      if 0 != execute(cmd, shell=True, cwd=BUILD_TEMP):
          sys.exit("\nERROR: Cannot find make? See above errors.")
  
file_path: Multicore-TSNE/setup.py
imports: import sys
  import shutil
  import os
  import subprocess
  from os import path
  from subprocess import call
  from setuptools.command.build_ext import build_ext
  from setuptools import setup, find_packages, Extension
label_desc: Use image node_id 4 for calling the CMakeBuild obj's underlying member method code with example usage: obj.build_extension(ext) without return types