Skip to content

Commit

Permalink
Add option to enable ACL debug build to meson
Browse files Browse the repository at this point in the history
There was no option to enable ACL_DEBUG rather than
specifying this symbol directly in the code, which is awkward
  • Loading branch information
ol-imorozko committed May 23, 2024
1 parent 09a31ff commit 87748d7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions controlplane/acl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <unordered_set>
#include <vector>

//#define ACL_DEBUG

#ifdef ACL_DEBUG
#define ACL_DEBUGLEVEL (1)
#else
Expand Down
4 changes: 4 additions & 0 deletions controlplane/acl/bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <tuple>
#include <vector>

#ifdef ACL_DEBUG
#include <string>
#endif

namespace acl
{

Expand Down
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ compiler_args += [
'-DYANET_VERSION_CUSTOM=' + get_option('version_custom'),
]

if get_option('enable_acl_debug')
compiler_args += '-DACL_DEBUG'
endif

# Add all global arguments at once
add_global_arguments(compiler_args, language: 'cpp')
Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ option('version_custom',
value: 'develop',
description: 'Set the custom string version.',
yield: true)

option('enable_acl_debug',
type: 'boolean',
value: false,
description: 'Enable ACL debug flags.')

0 comments on commit 87748d7

Please sign in to comment.