diff --git a/Makefile.am b/Makefile.am index f8f3d7e8c9..b6dfbb6b5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -931,6 +931,7 @@ libnm_core_libnm_core_la_CPPFLAGS = \ if WITH_JSON_VALIDATION libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS) +libnm_core_libnm_core_la_CFLAGS = -fcommon endif libnm_core_libnm_core_la_SOURCES = \ diff --git a/libnm-core/meson.build b/libnm-core/meson.build index bc2d087a15..e9e681d4fb 100644 --- a/libnm-core/meson.build +++ b/libnm-core/meson.build @@ -197,9 +197,12 @@ cflags = [ '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE', ] +libnm_core_c_args = cflags + if enable_json_validation libnm_core_sources += files('nm-json.c') deps += jansson_dep + libnm_core_c_args += ['-fcommon'] endif if (crypto_gnutls_dep.found()) @@ -237,8 +240,8 @@ libnm_core = static_library( 'nm-core', sources: libnm_core_sources_all, dependencies: deps, + c_args: libnm_core_c_args, link_with: libnm_crypto, - c_args: cflags, ) libnm_core_dep = declare_dependency(