Convert C++ version string to be define instead of include
This allows Qmake to use the version number as well as not requiring all other uses of the version string to strip double quotes from it. This also reduces the fragility of the version string as it was required to be a valid C++ char*, even in contexts where that wouldn't matter.
This commit is contained in:
@@ -13,7 +13,7 @@ def get_version_string():
|
||||
def set_version_string(new_version_string):
|
||||
remove(version_file_path)
|
||||
with open(version_file_path, "w") as file:
|
||||
file.write("\"" + new_version_string + "\"")
|
||||
file.write(new_version_string)
|
||||
|
||||
def main():
|
||||
current_version = get_version_string()
|
||||
|
||||
@@ -1 +1 @@
|
||||
"3.1.0-dev-new"
|
||||
3.1.0-dev-new
|
||||
@@ -12,7 +12,7 @@ def get_version_string():
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
with open(dir_path + "/../compile_version_string.txt", "r") as file:
|
||||
contents = file.readline()
|
||||
return contents.strip('"')
|
||||
return contents
|
||||
|
||||
|
||||
#Const globals
|
||||
|
||||
Reference in New Issue
Block a user