def on_save_build_script(self): library_path = QFileDialog.getExistingDirectory( self, 'Select a folder') if library_path == '': return host_system = utils.HOST_SYSTEM target_system = self.platform_var_list.currentText() functions = self.functions_names library_name = self.lib_name.text() threading = self.thread_var_list.currentText() == 'Multi-threaded' threading_layer_type = self.parent.get_treading_layer_type() package = utils.IPP if self.parent.source.ipp.isChecked( ) else utils.IPPCP os.environ[package + 'ROOT'] = settings.CONFIGS[package]['Path'] if self.IA32.isChecked(): generate_script( package, host_system, target_system, functions, library_path, library_name, utils.IA32, threading, threading_layer_type, ) if self.intel64.isChecked(): generate_script(package, host_system, target_system, functions, library_path, library_name, utils.INTEL64, threading, threading_layer_type) QMessageBox.about(self, 'Success', 'Generation completed!')
def save_build_script(self): self.get_selected_configs() extension = 'Script (*' + utils.BATCH_EXTENSIONS[ utils.HOST_SYSTEM] + ')' script_path = QFileDialog.getSaveFileName( self, 'Save build script as...', utils.CONFIGS[utils.BUILD_SCRIPT_NAME], extension)[0] if not script_path: return else: utils.CONFIGS[utils.BUILD_SCRIPT_NAME] = os.path.basename( os.path.splitext(script_path)[0] + utils.BATCH_EXTENSIONS[utils.HOST_SYSTEM]) utils.CONFIGS[utils.OUTPUT_PATH] = os.path.dirname(script_path) success = generate_script() QMessageBox.information( self, 'Success' if success else 'Failure', 'Generation completed!' if success else 'Generation failed!')
sys.exit("Error: " + cpu + " isn't supported for " + utils.HOST_SYSTEM + ' ' + architecture) custom_cpu_set = args.custom_dispatcher custom_library_name = args.name output_path = os.path.abspath(args.output_path) if not os.path.exists(output_path): os.makedirs(output_path) utils.set_configs_dict(package=package, functions_list=functions_list, architecture=architecture, thread_mode=thread_mode, threading_layer_type=threading_layer_type, custom_library_name=custom_library_name, output_path=output_path, custom_cpu_set=custom_cpu_set) if args.generate: success = generate_script() print('Generation', 'completed!' if success else 'failed!') else: build() else: from PyQt5.QtWidgets import QApplication from gui.app import MainAppWindow app = QApplication(sys.argv) ex = MainAppWindow() sys.exit(app.exec_())
with open(args.functions_file, 'r') as functions_list: functions += map(lambda x: x.replace('\n', ''), functions_list.readlines()) if args.function: functions += args.function if not os.getenv(root) or not os.path.exists(os.environ[root]): print('Please, set ' + root) exit() tool.utils.COMPILERS_AND_LIBRARIES_PATH = args.cnl if args.generate: if args.ia32: generate_script(package, tool.utils.HOST_SYSTEM, target_system, functions, path, args.name, tool.utils.IA32, args.multi_threaded, threading_layer_type) if args.intel64: generate_script(package, tool.utils.HOST_SYSTEM, target_system, functions, path, args.name, tool.utils.INTEL64, args.multi_threaded, threading_layer_type) print('Generation completed!') else: if args.ia32: build(package, tool.utils.HOST_SYSTEM, target_system, functions, path, args.name, tool.utils.IA32, args.multi_threaded, args.cnl, threading_layer_type) if args.intel64: build(package, tool.utils.HOST_SYSTEM, target_system, functions, path, args.name, tool.utils.INTEL64,
def test_generation(self): generate_script(tests.utils.HOST_SYSTEM, tests.utils.HOST_SYSTEM, self.functions, tests.utils.TEMPORARY_FOLDER, 'tmp_dll', self.domains, tests.utils.INTEL64, False) self.generator_assertion()