want_apparmor = get_option('apparmor')
want_openssl = get_option('openssl')
want_selinux = get_option('selinux')
+want_oss_fuzz = get_option('oss-fuzz')
want_seccomp = get_option('seccomp')
srcconf.set_quoted('DEFAULT_CGROUP_PATTERN', cgrouppattern)
add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language: 'c')
+if add_languages('cpp', required : want_oss_fuzz)
+ # Used only for tests
+ cxx = meson.get_compiler('cpp')
+ cxx_cmd = ' '.join(cxx.cmd_array())
+ add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
+endif
+
# Feature detection
## I/O uring.
if want_io_uring
srcconf.set10('HAVE_STATIC_LIBCAP', false)
endif
+if want_oss_fuzz
+ srcconf.set10('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', true)
+ srcconf.set10('RUN_ON_OSS_FUZZ', true)
+ fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
+endif
+
## PAM.
pam = cc.find_library('pam', has_headers: 'security/pam_modules.h', required: want_pam_cgroup)
srcconf.set10('HAVE_PAM', pam.found())
liblxc_dependencies += [liburing]
endif
-liblxc_link_whole = []
-if sanitize == 'none'
- liblxc_link_whole = [liblxc_static]
-endif
+liblxc_link_whole = [liblxc_static]
liblxc = shared_library(
'lxc',
option('usernet-db-path', type: 'string', value: 'lxc/nics',
description: 'User network database file path')
+
+option('oss-fuzz', type : 'boolean', value : 'false',
+ description : 'build against oss-fuzz')
liblxc_sources += files('lsm/selinux.c')
endif
-if sanitize == 'none'
- liblxc_static = static_library(
- 'lxc_static',
- liblxc_sources + include_sources + netns_ifaddrs_sources,
- install: true,
- include_directories: liblxc_includes,
- dependencies: [threads],
- c_args: '-fvisibility=default')
-endif
+liblxc_static = static_library(
+ 'lxc_static',
+ liblxc_sources + include_sources + netns_ifaddrs_sources,
+ install: true,
+ include_directories: liblxc_includes,
+ dependencies: [threads],
+ c_args: '-fvisibility=default')
lxc_functions = configure_file(
configuration: conf,