3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 04:03:39 +00:00

Teach the Python build system to use the `version.h.in` template file used

by the CMake build and use the existing ``configre_file()`` function
to generate the ``version.h`` file needed by the build.
This commit is contained in:
Dan Liew 2016-03-02 23:17:34 +00:00
parent 849c16c4fc
commit d54d6b50f0

View file

@ -2632,15 +2632,20 @@ def update_version():
# Update files with the version number # Update files with the version number
def mk_version_dot_h(major, minor, build, revision): def mk_version_dot_h(major, minor, build, revision):
c = get_component(UTIL_COMPONENT) c = get_component(UTIL_COMPONENT)
fout = open(os.path.join(c.src_dir, 'version.h'), 'w') version_template = os.path.join(c.src_dir, 'version.h.in')
fout.write('// automatically generated file.\n') version_header_output = os.path.join(c.src_dir, 'version.h')
fout.write('#define Z3_MAJOR_VERSION %s\n' % major) # Note the substitution names are what is used by the CMake
fout.write('#define Z3_MINOR_VERSION %s\n' % minor) # builds system. If you change these you should change them
fout.write('#define Z3_BUILD_NUMBER %s\n' % build) # in the CMake build too
fout.write('#define Z3_REVISION_NUMBER %s\n' % revision) configure_file(version_template, version_header_output,
fout.close() { 'Z3_VERSION_MAJOR': str(major),
'Z3_VERSION_MINOR': str(minor),
'Z3_VERSION_PATCH': str(build),
'Z3_VERSION_TWEAK': str(revision),
}
)
if VERBOSE: if VERBOSE:
print("Generated '%s'" % os.path.join(c.src_dir, 'version.h')) print("Generated '%s'" % version_header_output)
# Generate AssemblyInfo.cs files with the right version numbers by using ``AssemblyInfo.cs.in`` files as a template # Generate AssemblyInfo.cs files with the right version numbers by using ``AssemblyInfo.cs.in`` files as a template
def mk_all_assembly_infos(major, minor, build, revision): def mk_all_assembly_infos(major, minor, build, revision):