Skip to content

Commit

Permalink
slab_trace_analyzer: Hide behind Meson option and fix for GCC 13+
Browse files Browse the repository at this point in the history
Instead of using `build_by_default: false` just hide it behind a
flag.

Also add missing include that was previously transitively included by
some other header.
  • Loading branch information
qookei committed Jul 13, 2024
1 parent cc0ff0f commit 6b08458
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
30 changes: 21 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# frigg is header-only, so we do not need a compiler.
project('frigg')

# We already need C++ on the build system to build the analyzer.
add_languages('cpp', native: true)

incl = include_directories('include')

if not get_option('frigg_no_install')
Expand Down Expand Up @@ -58,19 +55,34 @@ endif

frigg_dep = declare_dependency(include_directories: incl)


build_tests = get_option('build_tests').enabled()

if get_option('build_tests').auto()
build_tests = not meson.is_subproject()
endif

build_slab_analyzer = get_option('build_slab_analyzer').enabled()

if get_option('build_slab_analyzer').auto()
build_slab_analyzer = not meson.is_subproject()
endif


if build_tests or build_slab_analyzer
# We need C++ only for the analyzer and test suite.
add_languages('cpp')
endif


if build_tests
subdir('tests')
endif

analyzer = executable(
'slab_trace_analyzer',
'slab_trace_analyzer.cpp',
override_options: ['cpp_std=c++20'],
build_by_default: false,
native: true)
if build_slab_analyzer
analyzer = executable(
'slab_trace_analyzer',
'slab_trace_analyzer.cpp',
override_options: ['cpp_std=c++20'],
native: true)
endif
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
option('frigg_no_install', type : 'boolean', value : false)
option('build_tests', type : 'feature', value : 'auto')
option('build_slab_analyzer', type : 'feature', value : 'disabled')
1 change: 1 addition & 0 deletions slab_trace_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <unordered_map>
#include <numeric>
#include <algorithm>
#include <cstdint>

#include <string.h>
#include <stdlib.h>
Expand Down

0 comments on commit 6b08458

Please sign in to comment.