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 2EE7E43086; Wed, 16 Aug 2023 23:56:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 086064325F; Wed, 16 Aug 2023 23:56:28 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5BC21411F3 for ; Wed, 16 Aug 2023 23:56:23 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B0959211F7A4; Wed, 16 Aug 2023 14:56:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B0959211F7A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1692222982; bh=NN2KEvV/wiy6dzxnoQbxniRicEq/DgLfdw6xnWyRhpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nj+Q2EKiMuV4BjO9fcDjX5lkKi2FiHWWLek7fJExU4n9JR4hqFL2IsBR9UKtYUcv4 QzSxV58l8td6Vv1y6eYwSJBcgrrNwOwrYGdKRV+JaADY7t3jGla4i2M+FhstrBM8HU eV4Pl3XcPdYrt5UDamYK411DaYoJC8vgjpWFdDKA= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , david.marchand@redhat.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH v5 4/4] build: enable MSVC specific compiler options Date: Wed, 16 Aug 2023 14:56:16 -0700 Message-Id: <1692222976-2908-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1692222976-2908-1-git-send-email-roretzla@linux.microsoft.com> References: <1674674707-3094-1-git-send-email-roretzla@linux.microsoft.com> <1692222976-2908-1-git-send-email-roretzla@linux.microsoft.com> 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 * Enable optional use of C11 atomics support. * Enable use of C23 typeof operator. * Explicitly force intrinsics when building with MSVC. * Disable MSVC C runtime checks. Signed-off-by: Tyler Retzlaff --- config/meson.build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/meson.build b/config/meson.build index 821a1c3..7a04347 100644 --- a/config/meson.build +++ b/config/meson.build @@ -27,6 +27,22 @@ dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1) is_ms_compiler = is_windows and (cc.get_id() == 'msvc') is_ms_linker = is_windows and (cc.get_id() == 'clang' or is_ms_compiler) +if is_ms_compiler + # force the use of intrinsics the MSVC compiler (except x86) + # does not support inline assembly + dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) + + # suppress warnings raised for using standard library functions + # the MSVC compiler regards as unsafe but are used by DPDK + dpdk_conf.set('_CRT_SECURE_NO_WARNINGS', 1) + + # enable non-locking atomic operations + add_project_arguments('/experimental:c11atomics', language: 'c') + + # enable typeof operator + add_project_arguments('/d1experimental:typeof', language: 'c') +endif + # set the major version, which might be used by drivers and libraries # depending on the configuration options pver = meson.project_version().split('.') -- 1.8.3.1