From patchwork Tue May 16 01:27:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 99839 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1801450qge; Mon, 15 May 2017 18:31:15 -0700 (PDT) X-Received: by 10.99.168.1 with SMTP id o1mr9034803pgf.105.1494898275062; Mon, 15 May 2017 18:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494898275; cv=none; d=google.com; s=arc-20160816; b=RYnMYbCrGFReXkRyFCpVDD/uLv9C1GEx2Smrsm/hEgRQDhQX72JLOtLlaDMbRKsRlO gmPZ3naBwPSwunck50v9zTK09Mdg29qUpon0EPVQ0Md0Eu2ZXJhkvACwGBKwe4vfaVFU fiAx2iGy3acDkmVw7Nfjs0gCYKr55ZSHHIzm1h+vWEsIznR5jAclZNxZdHFW6gUjiSqA 0sqyf8zVxTJ64sKDUdeiR+itF8Jln3582d52wGxrdDT16VxL2a71F/1oVgfI/X/ajKt4 RpnrJvMNZ1dsZ9FNlyv7rYQ037J38j33Pg5pYNbPqbXckAvIvdyGW/q0hNrpMPcSWm99 OOuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=esxsZGsctRSRBWDCcktfH0N0QIhObgGF6r4Q8uowVuU=; b=E0sbxzj9Hplc5Ow0yEp+En8iRqaJOx01ryqCxufh0bkIlmDBHswvI62jeoBOkASN6J 1Nj8UFDHIB0HiQojfBR4OsAp4S0OKBPG/S5XrytYZZI9vN4WRgrTNxk1JZpuE++yqbE7 JDMHGO96iu8U1pGYxEyYpLWnp5rh+H0aZH5isg4Z0RNA6g9nUgsa1WbcL3FZXv8l8JR4 ZNdebopsinXT5h0PR7JC7WNMXxbzQzrO8WON6PaHH/hCM8F7G4YYQtgWRyDlwYAJUXpX hxmV12rppTd9aqy9hnOo7GyD2OzvlVaUEEOTB9d+JvjAda22oXY2ptYkxJFU1JKMA8De lyPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=piglit-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id s186si10966727pgs.96.2017.05.15.18.31.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 18:31:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=piglit-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EA456E2A1; Tue, 16 May 2017 01:31:14 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 598866E2A1 for ; Tue, 16 May 2017 01:28:39 +0000 (UTC) Received: by mail-oi0-x22a.google.com with SMTP id w10so8312890oif.0 for ; Mon, 15 May 2017 18:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R52B/OTCH1/tgEejOHHFOXL3q9T2bbmCR51ljHD7FEU=; b=bKo6B9F22cjkrAXOku+H4Em7XsNwK1ZOsSVX/VaCbT12JEDr2oomdvCq2lxG9kFENx +FhvSjA9QxhcUUkrxJli2TQutqETt7lJN5M4CZ1H+BSMiT8ThSyuMGCysz16Dzd0YOTE panXsrWsVde9ZYCQwGOhtcmRHfRXkk2PoPaYU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R52B/OTCH1/tgEejOHHFOXL3q9T2bbmCR51ljHD7FEU=; b=qXCb35VDGvgBBncxnvi0/aahCsJP9iyv0ogme98QFX+cb+t72nvIGxUZ/L6fqiZ60o PlSNu+15+Tsu+iDCv3e/iwaYYifHdRr8JsMsZ4PVJ+uHuuZ4IvHFvKNDuIi0EHIHr15t WCcU0KXOL4I2N910elEWf0AvRFEVqHcpcKBBqT6zjNRLAndQsZhicV8JaVkDDD3ywd0c AvDmOKIAT9RsKnS6IRNaDhZZvealYxOLtfFm14apxgpdsyobfBPoYCbOZwuqKALXIrSJ 6akU4bHFlwgk8F/cmZK6n/4JhPz8oFBV/97USZG4/OCjjXthghMxMsJ12ggn5DsMSVKW 7eOg== X-Gm-Message-State: AODbwcB1xQW6nBl73KJtapp/4i3jm8J7JEzlm1bpYlvv/I+0q+95No2z D5YbhjctOV+rPP+/ X-Received: by 10.157.21.39 with SMTP id u36mr3911854otf.187.1494898118624; Mon, 15 May 2017 18:28:38 -0700 (PDT) Received: from aura.cortijodelrio.net (CableLink67-82.telefonia.InterCable.net. [201.172.67.82]) by smtp.googlemail.com with ESMTPSA id j60sm6170118otc.50.2017.05.15.18.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 18:28:37 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: piglit@lists.freedesktop.org Date: Mon, 15 May 2017 20:27:59 -0500 Message-Id: <1494898079-20284-1-git-send-email-daniel.diaz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494530251-17160-1-git-send-email-daniel.diaz@linaro.org> References: <1494530251-17160-1-git-send-email-daniel.diaz@linaro.org> MIME-Version: 1.0 Cc: baker.dylan.c@gmail.com Subject: [Piglit] [PATCH v4] CMake: define GBM_BO_MAP only when symbol is found X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: piglit-bounces@lists.freedesktop.org Sender: "Piglit" gbm_bo_map() and _unmap() have been added recently to Mesa, and this update may not have reached all implementations of GBM, such as the one provided by Mali r6, where said definitions can be found in the header file but not in the library itself. This leads to errors like the following when linking: ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap' ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map' collect2: error: ld returned 1 exit status make[2]: *** [bin/point-sprite] Error 1 Instead of relying on the header file, actually try to link using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP should be defined. Signed-off-by: Daniel Díaz Reviewed-by: Jan Vesely --- v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely. v3: Back to CHECK_FUNCTION_EXISTS. v4: Use ${GBM_LIBRARIES} instead of 'gbm'. CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ff99e..cc26fa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(GBM_FOUND) set(PIGLIT_HAS_GBM True) add_definitions(-DPIGLIT_HAS_GBM) - if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION VERSION_GREATER "12.1") - set(PIGLIT_HAS_GBM_BO_MAP True) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GBM_LIBRARIES}) + CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP) + if (PIGLIT_HAS_GBM_BO_MAP) add_definitions(-DPIGLIT_HAS_GBM_BO_MAP) endif() endif(GBM_FOUND)