Esempio n. 1
0
class CMakeBuilder(Builder):
    def __init__(self, name, cfg, build_dir):
        super(CMakeBuilder, self).__init__(name, cfg, build_dir)
        self.cmake = CMake()

    def Build(self):
        with os_utils.Chdir(self.build_dir):
            self.cmake.setFlag("CMAKE_BUILD_TYPE", config.get("build-type"))
            cmake_opts = self.build_cfg.get("cmake", {})
            cmake_flags = cmake_opts.get("flags", {})
            for k, v in cmake_flags.items():
                self.cmake.setFlag(k, v)
            # self.cmake.setFlag('CMAKE_INSTALL_PREFIX', self.install_prefix)
            self.cmake.generator = "NMake Makefiles"
            self.cmake.run(CMAKE=EXECUTABLES["cmake"])
            if cmake_opts.get("build", False):
                target = ""
                if cmake_flags.get("CMAKE_INSTALL_PREFIX") is not None:
                    target = "install"
                target = cmake_opts.get("build-target", target)
                self.cmake.build(target=target, CMAKE=EXECUTABLES["cmake"])
        return True
Esempio n. 2
0
  if not os.path.isdir(SOURCE_DIR):
    log.info('HHVM source code not found. SOURCE_DIR={}'.format(SOURCE_DIR))
    sys.exit(1)

  ENV.merge({
      'CC': cfg.get('bin.cc', 'gcc-4.8'),
      'CXX': cfg.get('bin.cxx', 'g++-4.8'),
      'ASM': cfg.get('bin.asm', 'cc'),

      'CMAKE_INCLUDE_PATH': tempfile.NamedTemporaryFile(delete=False).name,
      'CMAKE_LIBRARY_PATH': "/usr/lib/hhvm/",
      'HPHP_HOME': SOURCE_DIR,
      'MYSQL_UNIX_SOCK_ADDR': '/var/run/mysqld/mysqld.sock',
  })

  cmake = CMake()
  for k, v in cfg.get('env.cmake.flags', {}).items():
    cmake.setFlag(k, v)

  MAKE_FLAGS = cfg.get('env.make.flags', [])

  cmake.setFlag('CMAKE_BUILD_TYPE', 'Debug')
  cmake.setFlag('CMAKE_INSTALL_PREFIX', '/usr')

  configure_ccache(cfg, cmake)
  configure_distcc(cfg, cmake)
  configure_cotire(cfg, cmake)

  #job_flag = '-j' + str(cfg.get('env.make.jobs', 1))
  #MAKE_FLAGS += [job_flag]
Esempio n. 3
0
  log.info('HHVM Version {} - Debug: {}, Dev: {}, Nightly: {}'.format(HHVM_VERSION, bool2yn(DEBUG), bool2yn(DEVONLY), bool2yn(NIGHTLY)))

  env_ext = {
      'CC': cfg.get('bin.cc', 'gcc-4.8'),
      'CXX': cfg.get('bin.cxx', 'g++-4.8'),
      'ASM': cfg.get('bin.asm', 'cc'),

      'CMAKE_INCLUDE_PATH': tempfile.NamedTemporaryFile(delete=False).name,
      'CMAKE_LIBRARY_PATH': "/usr/lib/hhvm/",
      'HPHP_HOME': SOURCE_DIR,
      'MYSQL_UNIX_SOCK_ADDR': '/var/run/mysqld/mysqld.sock',
  }

  ENV.merge(env_ext)

  cmake = CMake()
  for k, v in cfg.get('env.cmake.flags', {}).items():
    cmake.setFlag(k, v)

  MAKE_FLAGS = cfg.get('env.make.flags', [])

  cmake.setFlag('CMAKE_BUILD_TYPE',     'Debug' if DEBUG else 'Release')
  cmake.setFlag('CMAKE_INSTALL_PREFIX', '/usr')
  cmake.setFlag('BOOST_LIBRARYDIR',     BOOST_LIBRARYDIR)
  cmake.setFlag('ENABLE_LD_GOLD',       "Off")

  configure_ccache(cfg, cmake)
  configure_distcc(cfg, cmake)
  configure_cotire(cfg, cmake)

  job_flag = '-j' + str(cfg.get('env.make.jobs', 1))
Esempio n. 4
0
 def __init__(self, name, cfg, build_dir):
     super(CMakeBuilder, self).__init__(name, cfg, build_dir)
     self.cmake = CMake()
Esempio n. 5
0
            cmake = CMake()
            cmake.setFlag('CMAKE_BUILD_TYPE', config.get('cmake.build-type'))
            cmake.setFlag('CMAKE_INSTALL_PREFIX', os.path.join(script_dir, 'install'))
            cmake.setFlag('gtest_force_shared_crt:BOOL', 'ON')
            cmake.generator = 'NMake Makefiles'
            cmake.run(CMAKE=EXECUTABLES['cmake'])
            cmake.build(CMAKE=EXECUTABLES['cmake'])
"""

asmjit_dir = os.path.join(script_dir, "build", "asmjit")
with log.info("Building asmjit..."):
    if not args.rebuild_all and filesAllExist(["asmjit.lib"], basedir="install/lib"):
        log.info("Skipping; All needed files built.")
    else:
        with os_utils.Chdir(asmjit_dir):
            cmake = CMake()
            cmake.setFlag("ASMJIT_STATIC", "TRUE")
            cmake.setFlag("ASMJIT_DISABLE_COMPILER", "TRUE")
            cmake.setFlag("CMAKE_BUILD_TYPE", config.get("cmake.build-type"))
            cmake.setFlag("CMAKE_INSTALL_PREFIX", os.path.join(script_dir, "install").replace("\\", "/"))
            cmake.generator = "NMake Makefiles"
            cmake.run(CMAKE=EXECUTABLES["cmake"])
            cmake.build(CMAKE=EXECUTABLES["cmake"], target="install")

# MUST be built with system Python because it includes pyexpat.
udis_dir = firstDirIn(os.path.join(script_dir, "build", "udis86"))
with log.info("Building udis..."):
    with os_utils.Chdir(udis_dir):
        os_utils.cmd(
            [EXECUTABLES["python"], "scripts/ud_itab.py", "docs/x86/optable.xml", "libudis86"],
            echo=True,