Import("env") import time ver = int( time.time() ) f = open("version.txt", "w") f.write(str(ver)) f.close() env.Append(CPPDEFINES=[ ("FW_VERSION", ver) ]) drone_semver = env["ENV"].get("DRONE_SEMVER") if drone_semver: env.Append(CPPDEFINES=[ ("DRONE_SEMVER", "\"" + drone_semver.replace("\"", "\\\"") + "\"") ])