(use_gpu=False)
| 29 | |
| 30 | |
| 31 | def copy_files(use_gpu=False): |
| 32 | |
| 33 | def copy_files_helper(folder_name): |
| 34 | src = os.path.join(CURRENT_DIR, os.path.pardir, folder_name) |
| 35 | if os.path.exists(src): |
| 36 | dst = os.path.join(CURRENT_DIR, 'compile', folder_name) |
| 37 | shutil.rmtree(dst, ignore_errors=True) |
| 38 | distutils.dir_util.copy_tree(src, dst, verbose=0) |
| 39 | else: |
| 40 | raise Exception('Cannot copy {0} folder'.format(src)) |
| 41 | |
| 42 | if not os.path.isfile(os.path.join(CURRENT_DIR, '_IS_SOURCE_PACKAGE.txt')): |
| 43 | copy_files_helper('include') |
| 44 | copy_files_helper('src') |
| 45 | if not os.path.exists(os.path.join(CURRENT_DIR, "compile", "windows")): |
| 46 | os.makedirs(os.path.join(CURRENT_DIR, "compile", "windows")) |
| 47 | distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.sln"), |
| 48 | os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.sln"), |
| 49 | verbose=0) |
| 50 | distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.vcxproj"), |
| 51 | os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.vcxproj"), |
| 52 | verbose=0) |
| 53 | if use_gpu: |
| 54 | copy_files_helper('compute') |
| 55 | distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "CMakeLists.txt"), |
| 56 | os.path.join(CURRENT_DIR, "compile", "CMakeLists.txt"), |
| 57 | verbose=0) |
| 58 | distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "LICENSE"), |
| 59 | os.path.join(CURRENT_DIR, "LICENSE"), |
| 60 | verbose=0) |
| 61 | |
| 62 | |
| 63 | def clear_path(path): |
no test coverage detected