Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CcsmOptionsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static llvm::cl::opt<bool>
llvm::cl::desc("Enable condition analysis for path counting"),
llvm::cl::init(false), llvm::cl::cat(CCSMToolCategory));

static llvm::cl::extrahelp MoreHelp("\nVersion: " GEN_VER_VERSION_STRING);
static llvm::cl::extrahelp MoreHelp("\nVersion: " GEN_VER_VERSION_STRING "\n");

static void PrintVersion(llvm::raw_ostream &OS) {
OS << "CCSM (https://github.com/bright-tools/ccsm):" << '\n'
Expand Down
9 changes: 3 additions & 6 deletions utils/gen_ver/gen_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@
def make_ver(git_dir=None):

# Get the version string
ver = subprocess.check_output(['git', 'describe', '--match', 'v[0-9]*', '--abbrev=7', 'HEAD'], cwd=git_dir, encoding='UTF-8')
# Check for local changes
chngs = subprocess.check_output(['git', 'diff-index', '--name-only', 'HEAD', '--'], cwd=git_dir, encoding='UTF-8')
ver = subprocess.check_output(['git', 'describe', '--tags', '--match', 'v[0-9]*', '--abbrev=7', '--dirty'],
cwd=git_dir, universal_newlines=True)

ver_str = ver.rstrip()
if len(chngs) > 0:
ver_str += ".dirty"

txt = ["/* Generated automatically by {} */".format(os.path.basename(__file__)),
'#define GEN_VER_VERSION_STRING "{}"'.format(ver_str),
]

return "\n".join(txt)
return "\n".join(txt) + "\n"


class Usage(Exception):
Expand Down