diff --git a/Makefile.am b/Makefile.am index 9a6b310414..f528788312 100644 --- a/Makefile.am +++ b/Makefile.am @@ -963,6 +963,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 9637afaad5..53d91babaa 100644 --- a/libnm-core/meson.build +++ b/libnm-core/meson.build @@ -200,9 +200,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()) @@ -240,8 +243,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(