Skip to content

Commit de38578

Browse files
dromerfalkTX
andauthored
only force APP_VERSION_MAJOR in modules as necessary (#884)
* force APP_VERSION_MAJOR to module version * compare first digit before forcing * compare like in Rack * Cleanup Signed-off-by: falkTX <falktx@falktx.com> * use rack-like var names Signed-off-by: falkTX <falktx@falktx.com> --------- Signed-off-by: falkTX <falktx@falktx.com> Co-authored-by: falkTX <falktx@falktx.com>
1 parent 9e26f98 commit de38578

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

plugins/plugins.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,17 @@ struct StaticPluginLoader {
10691069
return;
10701070
}
10711071

1072-
// force ABI, we use static plugins so this doesnt matter as long as it builds
1073-
json_t* const version = json_string((APP_VERSION_MAJOR + ".0").c_str());
1074-
json_object_set(rootJ, "version", version);
1075-
json_decref(version);
1072+
std::string version;
1073+
if (json_t* const versionJ = json_object_get(rootJ, "version"))
1074+
version = json_string_value(versionJ);
1075+
1076+
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
1077+
{
1078+
// force ABI, we use static plugins so this doesnt matter as long as it builds
1079+
json_t* const versionJ = json_string((APP_VERSION_MAJOR + ".0").c_str());
1080+
json_object_set(rootJ, "version", versionJ);
1081+
json_decref(versionJ);
1082+
}
10761083

10771084
// Load manifest
10781085
p->fromJson(rootJ);

0 commit comments

Comments
 (0)