mirror of
https://github.com/rui314/mold.git
synced 2024-10-27 05:29:10 +03:00
Show license information in the --help message
This commit is contained in:
parent
2b7b45c8d1
commit
1f67ccfa20
@ -1,2 +1,3 @@
|
|||||||
#define MOLD_VERSION "@mold_VERSION@"
|
#define MOLD_VERSION "@mold_VERSION@"
|
||||||
#define MOLD_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@"
|
#define MOLD_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@"
|
||||||
|
#cmakedefine01 MOLD_HAS_COMMERCIAL_LICENSE
|
||||||
|
14
main.cc
14
main.cc
@ -27,10 +27,20 @@ namespace macho {
|
|||||||
int main(int argc, char **argv);
|
int main(int argc, char **argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool has_commercial_license() {
|
||||||
|
if (MOLD_HAS_COMMERCIAL_LICENSE)
|
||||||
|
return true;
|
||||||
|
char *env = getenv("MOLD_HAS_COMMERCIAL_LICENSE");
|
||||||
|
return env && env[0];
|
||||||
|
}
|
||||||
|
|
||||||
static std::string get_mold_version() {
|
static std::string get_mold_version() {
|
||||||
|
std::string ver = "mold " MOLD_VERSION;
|
||||||
|
ver += has_commercial_license() ? " commercial edition" : " free edition";
|
||||||
|
|
||||||
if (mold_git_hash.empty())
|
if (mold_git_hash.empty())
|
||||||
return "mold " MOLD_VERSION " (compatible with GNU ld)";
|
return ver + " (compatible with GNU ld)";
|
||||||
return "mold " MOLD_VERSION " (" + mold_git_hash + "; compatible with GNU ld)";
|
return ver + " (" + mold_git_hash + "; compatible with GNU ld)";
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup() {
|
void cleanup() {
|
||||||
|
Loading…
Reference in New Issue
Block a user