Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A proposal for version check in clap-helpers #47

Merged
merged 1 commit into from
Jan 17, 2024
Merged
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: 2 additions & 0 deletions include/clap/helpers/host.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <clap/clap.h>

#include "version-check.hh"

#include "checking-level.hh"
#include "misbehaviour-handler.hh"

Expand Down
2 changes: 2 additions & 0 deletions include/clap/helpers/plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <clap/all.h>

#include "version-check.hh"

#include "checking-level.hh"
#include "host-proxy.hh"
#include "misbehaviour-handler.hh"
Expand Down
21 changes: 21 additions & 0 deletions include/clap/helpers/version-check.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

/*
* Check the clap version against the supported versions for this version of CLAP Helpers.
* It defines two clap versions, a min and max version, and static asserts that the CLAP
* we are using is in range.
*
* Workflow wise, if you are about to make clap-helpers incompatible with a version, set
* the prior version to max, commit and push, and then move the min to current and max to 2 0 0
* again.
*/

#include "clap/version.h"

#if CLAP_VERSION_LT(1,2,0)
static_assert(false, "Clap version must be at least 1.2.0")
#endif

#if CLAP_VERSION_GE(2,0,0)
static_assert(false, "Clap version must be at most 1.x")
#endif
Loading