From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 283A543BC7; Fri, 8 Mar 2024 12:59:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BD3E42F3F; Fri, 8 Mar 2024 12:59:01 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B34B540291 for ; Fri, 8 Mar 2024 12:58:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709899139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vukm7VAXP9a3JdCPMK9nCoASehCyfCfeIOGbklfiVOc=; b=EKoF18cywwjNLlFZpYqTVA7Kfru7di0HbW6ou9FohmuL8i8IZ1ocuMoMHzEl9PM7TsFmAq Mq0fMfHOQ7NmYtG+qrKmB7/U0Kkic7BSYTw5MzwWdtWx7p/UDF+jOiDE5/bOTyMeJkaXjb 7qTVur0ngBdaH4MAD2xF6MoMkDkJ+qI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-OTwmGb7SM4qw-Sn6PSJpUQ-1; Fri, 08 Mar 2024 06:58:56 -0500 X-MC-Unique: OTwmGb7SM4qw-Sn6PSJpUQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFDFC85A58C; Fri, 8 Mar 2024 11:58:55 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 632FB111D785; Fri, 8 Mar 2024 11:58:54 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: stable@dpdk.org, Stephen Hemminger , Ben Magistro , Bruce Richardson Subject: [PATCH] build: pass cflags in subproject Date: Fri, 8 Mar 2024 12:58:40 +0100 Message-ID: <20240308115839.320793-2-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When DPDK is used as a subproject, include the required compile arguments so that the parent project is also built with the appropriate cflags (most importantly -march). Use the same cflags as pkg-config. Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject") Cc: stable@dpdk.org Signed-off-by: Robin Jarry --- buildtools/subproject/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build index 322e01c02969..203c5d36c6e9 100644 --- a/buildtools/subproject/meson.build +++ b/buildtools/subproject/meson.build @@ -2,10 +2,15 @@ # Copyright(c) 2022 Intel Corporation message('DPDK subproject linking: ' + get_option('default_library')) +subproject_cflags = ['-include', 'rte_config.h'] + machine_args +if is_freebsd + subproject_cflags += ['-D__BSD_VISIBLE'] +endif if get_option('default_library') == 'static' dpdk_dep = declare_dependency( version: meson.project_version(), dependencies: dpdk_static_lib_deps, + compile_args: subproject_cflags, # static library deps in DPDK build don't include "link_with" parameters, # so explicitly link-in both libs and drivers link_whole: dpdk_static_libraries + dpdk_drivers, @@ -13,6 +18,7 @@ if get_option('default_library') == 'static' else dpdk_dep = declare_dependency( version: meson.project_version(), + compile_args: subproject_cflags, # shared library deps include all necessary linking parameters dependencies: dpdk_shared_lib_deps) endif -- 2.44.0