Skip to content

Commit c7b8c11

Browse files
klemens-morgensternvinniefalco
authored andcommitted
set and ensure minimum version of LLVM
Closes #115.
1 parent 883a307 commit c7b8c11

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

include/mrdox/Platform.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
namespace clang {
2222
namespace mrdox {
2323

24+
/** The minimum version of LLVM required
25+
*/
26+
#define MRDOX_MINIMUM_LLVM_VERSION 15
27+
2428
//------------------------------------------------
2529
//
2630
// Shared Libraries

source/api/Config.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@
1212
#include "ConfigImpl.hpp"
1313
#include "Support/Path.hpp"
1414
#include <mrdox/Error.hpp>
15+
16+
#include <llvm/Config/llvm-config.h>
1517
#include <llvm/Support/FileSystem.h>
1618
#include <llvm/Support/Path.h>
1719
#include <llvm/Support/YAMLParser.h>
1820
#include <llvm/Support/YAMLTraits.h>
1921

22+
// Check llvm version
23+
#define STRINGIFY(Value) #Value
24+
static_assert(
25+
LLVM_VERSION_MAJOR >= MRDOX_MINIMUM_LLVM_VERSION,
26+
"MrDox requires at least clang " STRINGIFY(MRDOX_MINIMUM_LLVM_VERSION)
27+
", got " LLVM_VERSION_STRING " instead.");
28+
2029
namespace clang {
2130
namespace mrdox {
2231

0 commit comments

Comments
 (0)