Skip to content

Commit

Permalink
meson: Add libhugetlbfs option to not included in stand alone
Browse files Browse the repository at this point in the history
libhugetlbfs does not support static library
libhugetlbfs/libhugetlbfs#11

Signed-off-by: Steven Seungcheol Lee <[email protected]>
  • Loading branch information
sc108-lee committed Oct 11, 2023
1 parent c39eed6 commit 04362fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ debug:
standalone:
meson ${BUILD-DIR} --buildtype=release \
--default-library=static -Dc_link_args="-static" \
--wrap-mode=forcefallback
--wrap-mode=forcefallback -Dlibhugetlbfs=disabled
ninja -C ${BUILD-DIR}
@echo "Standalone binary dose not support libhugetlbfs"
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ endif
conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?')

# Check for libhugetlbfs availability (optional)
if cc.has_header('hugetlbfs.h')
if not get_option('libhugetlbfs').disabled() and cc.has_header('hugetlbfs.h')
libhugetlbfs_dep = cc.find_library('hugetlbfs',
required : false)
else
Expand Down
7 changes: 7 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@ option(
type : 'string',
description : 'override the git version string'
)

option(
'libhugetlbfs',
type: 'feature',
value: 'auto',
description : 'Use libhugetlbfs if library is exist when this option is not disabled'
)

0 comments on commit 04362fb

Please sign in to comment.