()
| 93 | btc_config.writelines(template) |
| 94 | |
| 95 | def main(): |
| 96 | parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.') |
| 97 | parser.add_argument('-toolset', nargs='?',help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019.' |
| 98 | ' default is %s.'%DEFAULT_PLATFORM_TOOLSET) |
| 99 | args = parser.parse_args() |
| 100 | if args.toolset: |
| 101 | set_common_properties(args.toolset) |
| 102 | |
| 103 | for makefile_name in os.listdir(SOURCE_DIR): |
| 104 | if 'Makefile' in makefile_name: |
| 105 | parse_makefile(os.path.join(SOURCE_DIR, makefile_name)) |
| 106 | for key, value in lib_sources.items(): |
| 107 | vcxproj_filename = os.path.abspath(os.path.join(os.path.dirname(__file__), key, key + '.vcxproj')) |
| 108 | content = '' |
| 109 | for source_filename, object_filename in value: |
| 110 | content += ' <ClCompile Include="..\\..\\src\\' + source_filename + '">\n' |
| 111 | content += ' <ObjectFileName>$(IntDir)' + object_filename + '</ObjectFileName>\n' |
| 112 | content += ' </ClCompile>\n' |
| 113 | with open(vcxproj_filename + '.in', 'r', encoding='utf-8') as vcxproj_in_file: |
| 114 | with open(vcxproj_filename, 'w', encoding='utf-8') as vcxproj_file: |
| 115 | vcxproj_file.write(vcxproj_in_file.read().replace( |
| 116 | '@SOURCE_FILES@\n', content)) |
| 117 | parse_config_into_btc_config() |
| 118 | copyfile(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h'), os.path.join(SOURCE_DIR, 'config/bitcoin-config.h')) |
| 119 | copyfile(os.path.join(SOURCE_DIR,'../build_msvc/libsecp256k1_config.h'), os.path.join(SOURCE_DIR, 'secp256k1/src/libsecp256k1-config.h')) |
| 120 | |
| 121 | if __name__ == '__main__': |
| 122 | main() |
no test coverage detected