From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9CB1C2B9F4 for ; Fri, 25 Jun 2021 08:51:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 974156141C for ; Fri, 25 Jun 2021 08:51:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 974156141C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwhYi-0001aJ-N3 for qemu-devel@archiver.kernel.org; Fri, 25 Jun 2021 04:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwhY3-0000uI-L4 for qemu-devel@nongnu.org; Fri, 25 Jun 2021 04:50:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20191) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwhY2-00015A-1d for qemu-devel@nongnu.org; Fri, 25 Jun 2021 04:50:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624611049; 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: in-reply-to:in-reply-to:references:references; bh=h39BBZH0j5+9TSxR6UfabDbH8P14musJtvsXWENAVFI=; b=Bg9wdl9p5l/6IISGgiWVU6WI+bjWNSE9aATGXbQgJMBx1E6X1WnvmbtPyhNcwND1V+r5Cu HCPoDiFPS5gFwHhm4vpjnCz4MrCIUaVXuK9inSsqIlg0NHJytts/W5Xk6n6MUkcYI4llhX XO8MOoz0pXJ4B7T1ez534JzIpwQVkAU= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-2vlccYWqM6WXg0DrJLNofQ-1; Fri, 25 Jun 2021 04:50:48 -0400 X-MC-Unique: 2vlccYWqM6WXg0DrJLNofQ-1 Received: by mail-ed1-f72.google.com with SMTP id w1-20020a0564022681b0290394cedd8a6aso4791554edd.14 for ; Fri, 25 Jun 2021 01:50:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=h39BBZH0j5+9TSxR6UfabDbH8P14musJtvsXWENAVFI=; b=MsmdWqFhNnk6fVd5tlGV3ICB452Ziwik/X4Ow3vTO+JTRyHSVsoe/zaGPiXbdaZHQn VfzyejrxzMbIZw8xyqRQNtjYnwA7AopUpCBndut8mj1zB4SXHE48gnBKyEoeaKb9xVdU tI1HUIcxFK7fGPE7gidRYZ9JMVWPRwSPf+noi0MQu8WAPikXDPSYeP/O2qIIoBW3D3dL jrjYfoQYLJXtY5fTmnhgVniIDpaHbAoq3Mcqfq0nvYBog0chRdRBBL0fOiwcgrdU+ZxZ g4Kcy7cJufr9FPRdkUltMiYPeOVE3EgEVJHtyJ4D9Wv1WjTpOFCndDwXeZWtpG5IGfWU dxKw== X-Gm-Message-State: AOAM533p1emhUTk/qLRJMKvBKIyvrpCnELFcZeb0r0ruCpFGdvzlDYsK y4dJ2GBC/iMQ4GrQdnio3lF1dKx8BMnOtxtpKvLuLqNBpUPdoWSWHUnQuMpa2JBMA/h72bPL6X1 q43SRLz7oN2tdnyW/pndx3sFMMIOG7XUkBfHrHbeMu6YOVHDMXed6o+jdXEkoytJbNYo= X-Received: by 2002:aa7:d74d:: with SMTP id a13mr13208548eds.43.1624611046662; Fri, 25 Jun 2021 01:50:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCkB+aNqYio70oxsl+UGix1ZBZ9n7FGNp2Nr5v3jKBVUT+PtyrOQQ2hL/RN6Omzjmh8cSPtA== X-Received: by 2002:aa7:d74d:: with SMTP id a13mr13208521eds.43.1624611046430; Fri, 25 Jun 2021 01:50:46 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u21sm2411500eja.59.2021.06.25.01.50.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jun 2021 01:50:45 -0700 (PDT) Subject: Re: [PULL 09/12] configure, meson: convert libusb detection to meson To: luoyonggang@gmail.com References: <20210623121424.1259496-1-pbonzini@redhat.com> <20210623121424.1259496-10-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <91cd2b0f-8caf-f2b9-8022-3eddfcb96828@redhat.com> Date: Fri, 25 Jun 2021 10:50:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.362, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Daniel_P_=2e_Berrang=c3=a9?= , qemu-level Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 25/06/21 04:09, 罗勇刚(Yonggang Luo) wrote: > > > +if not get_option('libusb').auto() or have_system > > +  libusb = dependency('libusb-1.0', required: get_option('libusb'), > > +                      version: '>=1.0.13', method: 'pkg-config', > > +                      kwargs: static_kwargs) > >  endif > > Hi, I am not sure if it's right, but I think the dection may need > convert to this: > > ``` > if not get_option('libusb').disabled() >   libusb = dependency('libusb-1.0', required: get_option('libusb').auto(), >                       version: '>=1.0.13', method: 'pkg-config', >                       kwargs: static_kwargs) No, Meson knows what to do with feature objects passed to "required". With Meson 0.59 however it will be possible to write libusb = dependency('libusb-1.0', required: get_option('libusb').disable_auto_if(not have_system), version: '>=1.0.13', method: 'pkg-config', kwargs: static_kwargs) without any if. Paolo