def cmake_compiler_flags(self, c_compiler, cxx_compiler, linker=None, path=None): c_compiler_flag = '-DCMAKE_C_COMPILER=%s' % (util.cmake_pjoin( path, c_compiler), ) cxx_compiler_flag = '-DCMAKE_CXX_COMPILER=%s' % (util.cmake_pjoin( path, cxx_compiler), ) if linker is None: linker_flag = '' else: linker_flag = '-DCMAKE_LINKER=%s' % (util.cmake_pjoin( path, linker), ) if os.name == 'nt': c_compiler_flag += '.exe' cxx_compiler_flag += '.exe' linker_flag += '.exe' flags = [ c_compiler_flag, cxx_compiler_flag, ] if linker is not None: flags += [ linker_flag, ] return flags
def cmake_compiler_flags( self, c_compiler, cxx_compiler, linker=None, path=None): c_compiler_flag = '-DCMAKE_C_COMPILER=%s' % ( util.cmake_pjoin(path, c_compiler),) cxx_compiler_flag = '-DCMAKE_CXX_COMPILER=%s' % ( util.cmake_pjoin(path, cxx_compiler),) if linker is None: linker_flag = '' else: linker_flag = '-DCMAKE_LINKER=%s' % ( util.cmake_pjoin(path, linker),) if os.name == 'nt': c_compiler_flag += '.exe' cxx_compiler_flag += '.exe' linker_flag += '.exe' flags = [ c_compiler_flag, cxx_compiler_flag, ] if linker is not None: flags += [ linker_flag, ] return flags
def stage_cmake_args(self, cmake_args, extra_cmake_args, c_compiler, cxx_compiler, linker, previous_stage_bin): return (cmake_args + [ '-DCMAKE_AR=%s' % (util.cmake_pjoin(previous_stage_bin, 'llvm-ar'), ), '-DCMAKE_RANLIB=%s' % (util.cmake_pjoin(previous_stage_bin, 'llvm-ranlib'), ), ] + self.cmake_compiler_flags(c_compiler, cxx_compiler, linker, previous_stage_bin) + extra_cmake_args)
def stage_cmake_args( self, cmake_args, extra_cmake_args, c_compiler, cxx_compiler, linker, previous_stage_bin): return ( cmake_args + [ '-DCMAKE_AR=%s' % ( util.cmake_pjoin(previous_stage_bin, 'llvm-ar'),), '-DCMAKE_RANLIB=%s' % ( util.cmake_pjoin(previous_stage_bin, 'llvm-ranlib'),), ] + self.cmake_compiler_flags( c_compiler, cxx_compiler, linker, previous_stage_bin) + extra_cmake_args)
def cmake(self, stage_name, build_dir, source_dir, cmake='cmake', cmake_args=None): self.report_build_step('%s cmake' % (stage_name, )) self.halt_on_failure() cmd = [cmake] if cmake_args is not None: cmd += cmake_args cmd += [util.cmake_pjoin(source_dir, 'llvm')] util.mkdirp(build_dir) util.report_run_cmd(cmd, cwd=build_dir)