def _configure(self, context): context.try_skip(self.build_path) cross_option = "" if not self.target.force_native_build and self.buildEnv.cmake_crossfile: cross_option = "-DCMAKE_TOOLCHAIN_FILE={}".format( self.buildEnv.cmake_crossfile) command = ("cmake {configure_option}" " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" " -DCMAKE_INSTALL_PREFIX={install_dir}" " -DCMAKE_INSTALL_LIBDIR={libdir}" " {source_path}" " {cross_option}") command = command.format(configure_option=self.configure_option, install_dir=self.buildEnv.install_dir, libdir=self.buildEnv.libprefix, source_path=self.source_path, cross_option=cross_option) env = Defaultdict(str, os.environ) if self.buildEnv.platformInfo.static: env['CFLAGS'] = env['CFLAGS'] + ' -fPIC' env['CXXFLAGS'] = env['CXXFLAGS'] + ' -fPIC' if self.configure_env: for k in self.configure_env: if k.startswith('_format_'): v = self.configure_env.pop(k) v = v.format(buildEnv=self.buildEnv, env=env) self.configure_env[k[8:]] = v env.update(self.configure_env) run_command(command, self.build_path, context, env=env, buildEnv=self.buildEnv, cross_env_only=True)
def _configure(self, context): context.try_skip(self.build_path) command = "{configure_script} {configure_option}" command = command.format( configure_script=pj(self.source_path, self.configure_script), configure_option=self.all_configure_option ) env = Defaultdict(str, os.environ) if self.buildEnv.platformInfo.static: env['CFLAGS'] = env['CFLAGS'] + ' -fPIC' env['CXXFLAGS'] = env['CXXFLAGS'] + ' -fPIC' if self.configure_env: for k in self.configure_env: if k.startswith('_format_'): v = self.configure_env.pop(k) v = v.format(buildEnv=self.buildEnv, env=env) self.configure_env[k[8:]] = v env.update(self.configure_env) run_command(command, self.build_path, context, buildEnv=self.buildEnv, env=env)
def _compile(self, context): platformInfo = self.buildEnv.platformInfo if platformInfo.build == 'native': return super()._compile(context) context.try_skip(self.build_path) command = "make -j4 {make_target} {make_option}".format( make_target=self.make_target, make_option=self.make_option ) libmagic_native_builder = get_target_step('libmagic', 'native_static') env = Defaultdict(str, os.environ) env['PATH'] = ':'.join([pj(libmagic_native_builder.build_path, 'src'), env['PATH']]) run_command(command, self.build_path, context, buildEnv=self.buildEnv, env=env)