project_source_root).stdout().strip()
conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
-conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(),
- description : 'tailor build to development or release builds')
+conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer',
+ description : 'tailor build to development or release builds')
want_ossfuzz = get_option('oss-fuzz')
want_libfuzzer = get_option('llvm-fuzz')
libcurl = []
endif
conf.set10('HAVE_LIBCURL', have)
-conf.set10('CURL_NO_OLDIES', get_option('mode') == 'developer')
+conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1)
want_libidn = get_option('libidn')
want_libidn2 = get_option('libidn2')
'} >@OUTPUT@'],
build_by_default : true)
-# We intentionally do not do inline initializations with definitions for
-# a bunch of _cleanup_ variables in tests, to ensure valgrind is triggered.
-# This triggers a lot of maybe-uninitialized false positives when the
-# combination of -O2 and -flto is used. Suppress them.
-no_uninit = '-O2' in get_option('c_args') and '-flto=auto' in get_option('c_args') ? cc.first_supported_argument('-Wno-maybe-uninitialized') : []
+test_cflags = ['-DTEST_CODE=1']
+# We intentionally do not do inline initializations with definitions for a
+# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
+# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
+# false positives when the combination of -O2 and -flto is used. Suppress them.
+if '-O2' in get_option('c_args') and '-flto=auto' in get_option('c_args')
+ test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
+endif
+
foreach tuple : tests
sources = tuple[0]
link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
condition = tuple.length() > 4 ? tuple[4] : ''
type = tuple.length() > 5 ? tuple[5] : ''
defs = tuple.length() > 6 ? tuple[6] : []
- defs += no_uninit
+ defs += test_cflags
parallel = tuple.length() > 7 ? tuple[7] : true
timeout = 30
'test-libudev-sym',
test_libudev_sym_c,
include_directories : libudev_includes,
- c_args : ['-Wno-deprecated-declarations'] + no_uninit,
+ c_args : ['-Wno-deprecated-declarations'] + test_cflags,
link_with : [libudev],
build_by_default : want_tests != 'false',
install : install_tests,
'test-libudev-static-sym',
test_libudev_sym_c,
include_directories : libudev_includes,
- c_args : ['-Wno-deprecated-declarations'] + no_uninit,
+ c_args : ['-Wno-deprecated-declarations'] + test_cflags,
link_with : [install_libudev_static],
build_by_default : want_tests != 'false' and static_libudev_pic,
install : install_tests and static_libudev_pic,
include_directories : [incs, include_directories('src/fuzz')],
link_with : link_with,
dependencies : dependencies,
- c_args : defs,
+ c_args : defs + test_cflags,
link_args: link_args,
install : false,
build_by_default : fuzz_tests or fuzzer_build)
'@INPUT@'],
input : dbus_docs)
- if conf.get('BUILD_MODE') == 'BUILD_MODE_DEVELOPER'
+ if conf.get('BUILD_MODE_DEVELOPER') == 1
test('dbus-docs-fresh',
update_dbus_docs_py,
args : ['--build-dir=@0@'.format(project_build_root),