mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
build: Do not modify common.init.vcxproj
directly
This commit is contained in:
@@ -50,13 +50,6 @@ def parse_makefile(makefile):
|
||||
lib_sources[current_lib] = []
|
||||
break
|
||||
|
||||
def set_common_properties(toolset):
|
||||
with open(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), 'r', encoding='utf-8') as rfile:
|
||||
s = rfile.read()
|
||||
s = re.sub('<PlatformToolset>.*?</PlatformToolset>', '<PlatformToolset>'+toolset+'</PlatformToolset>', s)
|
||||
with open(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), 'w', encoding='utf-8',newline='\n') as wfile:
|
||||
wfile.write(s)
|
||||
|
||||
def parse_config_into_btc_config():
|
||||
def find_between( s, first, last ):
|
||||
try:
|
||||
@@ -99,11 +92,11 @@ def set_properties(vcxproj_filename, 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.'
|
||||
parser.add_argument('-toolset', nargs='?', default=DEFAULT_PLATFORM_TOOLSET,
|
||||
help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019.'
|
||||
' default is %s.'%DEFAULT_PLATFORM_TOOLSET)
|
||||
args = parser.parse_args()
|
||||
if args.toolset:
|
||||
set_common_properties(args.toolset)
|
||||
set_properties(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), '@TOOLSET@', args.toolset)
|
||||
|
||||
for makefile_name in os.listdir(SOURCE_DIR):
|
||||
if 'Makefile' in makefile_name:
|
||||
@@ -115,7 +108,7 @@ def main():
|
||||
content += ' <ClCompile Include="..\\..\\src\\' + source_filename + '">\n'
|
||||
content += ' <ObjectFileName>$(IntDir)' + object_filename + '</ObjectFileName>\n'
|
||||
content += ' </ClCompile>\n'
|
||||
set_properties(vcxproj_filename, '@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'))
|
||||
|
Reference in New Issue
Block a user