78 | + config_dict = dict(item.split(", ") for item in config_info)
79 | + config_dict["PACKAGE_VERSION"] = f"\"{config_dict['CLIENT_VERSION_MAJOR']}.{config_dict['CLIENT_VERSION_MINOR']}.{config_dict['CLIENT_VERSION_BUILD']}\""
80 | + version = config_dict["PACKAGE_VERSION"].strip('"')
81 | + config_dict["PACKAGE_STRING"] = f"\"Bitcoin Core {version}\""
82 | +
83 | + for line in fileinput.input(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h', ), inplace=True):
- Might want to remove the current values from
build_msvc/bitcoin_config.h to make it clear that this script needs to be run (and to pre-empt people from filing PRs to update the stale info).
- Instead of changing this file in-place I'd prefer renaming it to
build_msvc/bitcoin_config.h.in (or such) in the build system, then making a copy to build_msvc/bitcoin_config.h here. This avoids the generated state from being checked in accidentally.
Hi @laanwj,
did I understand this correctly ?
build_msvc/bitcoin_config.h.in is basically a empty template and everytime
build_msvc/msvc-autogen.py is executed it generates build_msvc/bitcoin_config.h using build_msvc/bitcoin_config.h.in and the values from configure.ac.
Yes, that sounds good to me. build_msvc/bitcoin_config.h.in would be the (read-only) template, with substitution strings that will be filled in by the script and written to build_msvc/bitcoin_config.h.
Yes, that sounds good to me. build_msvc/bitcoin_config.h.in would be the (read-only) template, with substitution strings > that will be filled in by the script and written to build_msvc/bitcoin_config.h.
Ok, I changed the code. It should work the way you mentioned now.