mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
build, refactor: Add set_properties() to msvc-autogen.py
This commit is contained in:
parent
9ce1c506a3
commit
2391fb7850
1 changed files with 6 additions and 4 deletions
|
@ -92,6 +92,11 @@ def parse_config_into_btc_config():
|
|||
with open(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h'), "w", encoding="utf8") as btc_config:
|
||||
btc_config.writelines(template)
|
||||
|
||||
def set_properties(vcxproj_filename, placeholder, content):
|
||||
with open(vcxproj_filename + '.in', 'r', encoding='utf-8') as vcxproj_in_file:
|
||||
with open(vcxproj_filename, 'w', encoding='utf-8') as vcxproj_file:
|
||||
vcxproj_file.write(vcxproj_in_file.read().replace(placeholder, content))
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.')
|
||||
parser.add_argument('-toolset', nargs='?',help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019.'
|
||||
|
@ -110,10 +115,7 @@ def main():
|
|||
content += ' <ClCompile Include="..\\..\\src\\' + source_filename + '">\n'
|
||||
content += ' <ObjectFileName>$(IntDir)' + object_filename + '</ObjectFileName>\n'
|
||||
content += ' </ClCompile>\n'
|
||||
with open(vcxproj_filename + '.in', 'r', encoding='utf-8') as vcxproj_in_file:
|
||||
with open(vcxproj_filename, 'w', encoding='utf-8') as vcxproj_file:
|
||||
vcxproj_file.write(vcxproj_in_file.read().replace(
|
||||
'@SOURCE_FILES@\n', content))
|
||||
set_properties(vcxproj_filename, '@SOURCE_FILES@\n', content):
|
||||
parse_config_into_btc_config()
|
||||
copyfile(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h'), os.path.join(SOURCE_DIR, 'config/bitcoin-config.h'))
|
||||
copyfile(os.path.join(SOURCE_DIR,'../build_msvc/libsecp256k1_config.h'), os.path.join(SOURCE_DIR, 'secp256k1/src/libsecp256k1-config.h'))
|
||||
|
|
Loading…
Reference in a new issue