From patchwork Thu May 11 19:17:31 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: 99668 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp824220obb; Thu, 11 May 2017 12:18:17 -0700 (PDT) X-Received: by 10.98.87.203 with SMTP id i72mr98041pfj.151.1494530297881; Thu, 11 May 2017 12:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494530297; cv=none; d=google.com; s=arc-20160816; b=D9oV6wceDsMbhEdvwuGJlU6LJcU3ArRcCkoxygp4YDOUoCmq2/d0jt43YH+ySVJYEa SV7y4izubxCmsTt06UOG6BB4PKMxiGE9womnRvDmtDALH7tv33K+An9eOdT/EbVEluAR cs7bgnQ+9P9MyajgKSzx/p6XMX2zxW+by8xKarw1JKTf3sUJCLbaosEBgZQuwLw7eOvI 1MGAUeLXM19CSZogzonxrDHqGhB8+WsEYcmkmRm741h9162aqRwmdF1Fwlkiz8cXLCT0 mCjTcInp0oCQpE8UAtZYiCWSUKz73T/bMlRv8a2IUSN2NZcXNP4aoBNBTeMeNb0lprEF KGwQ== 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:message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=PwfA06E6nXI4xuf/YrTpw1wLCqRs+2nuJE90qN/kI7I=; b=gxf2/a19kDuQe3fEJrsH2vYZnZqoVpnkoG4MEHlTJtlYOE3usNhRES0pPLAItZiLfj KZiISxEN5oqtipnFaiJo++0oQnVeuNlaY3M+dmVKjmSaugfx1aHZZx4w/DfjpnxJH2p4 V0TRu6xnEDwoX4TSOK3WzaBq7paiZxOfUu90kpVW5ud8SxNeMHnKkfIPyW1RiWCT2F2M Xq/Ek4qMe8jhFI9IpucNp6hFPaDMFigAP3DcXsiRqRJThltOVKIswpWRdmJn99+oqHyC JI3gkCcxFe2HbI3P3MVXJpdh12sATO/RfC+pD7/7XJ3l+0AXGH3verKSaMpmgL++lZj0 sYhg== 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 s197si897044pgs.96.2017.05.11.12.18.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 12:18:17 -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 494476E5C1; Thu, 11 May 2017 19:17:47 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id D69336E5B7 for ; Thu, 11 May 2017 19:17:45 +0000 (UTC) Received: by mail-oi0-x22f.google.com with SMTP id l18so42013708oig.2 for ; Thu, 11 May 2017 12:17:45 -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:mime-version :content-transfer-encoding; bh=COhrMLruSpXql8Bv+pdcFYnCbwFKLDLuTM/W7z5TH+4=; b=WbeD5b9VGq/Xx97YrJjRRCOHv4JnnMif6NezWy9vSFd++e2y2/p2AI54z7VMDaI+1I Gpsr7fGtmHvGbUBKDnB+4stWHgyRMyc4lHj9W4DwefT9wH6EzUKchKwm5t+9gWfJdzav vbbO6wDcYIcW2/hwHCYzlU54TKDnGfY4DJLVQ= 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:mime-version :content-transfer-encoding; bh=COhrMLruSpXql8Bv+pdcFYnCbwFKLDLuTM/W7z5TH+4=; b=rdDSXQ80g709Q//Gk2uBfHKlxlnw0V8nw2fBSXaHaqH/w5xksV0Q5NCWmbQvHf9nJR 0INotr8o4sQm+C1ZwKzqnNI3xVUgdYWncZV1yOo6Il70rS73ggWQ68RCEnGVsPokGrjv XOApATbjiDfOJRitZPHG260Uatg8NlmxRl8Xa2eOxOYGgPtHm0C5iVctmVEsYZJDN6Vz +tATZL4GqhigznUn4fVY3VgjdJDm0vn9m320H6rV3rRAwq8OTNIqSJG5eQOPAe5Qlycr kyLQvALzPGUosrKHYAkGXKxa/Zg7B8pJu3TNs6OD1nNWk9F3j0lMWxj6kEocnIqMtm2e q30w== X-Gm-Message-State: AODbwcB0qJi0LlyC5ov96PDgqE1cawvXH618RdlsJWLJhVmsxWCBcE3g UZOQjVWUOdO68c6P X-Received: by 10.157.18.168 with SMTP id g37mr47729otg.261.1494530264897; Thu, 11 May 2017 12:17:44 -0700 (PDT) Received: from aura.cortijodelrio.net (CableLink67-82.telefonia.InterCable.net. [201.172.67.82]) by smtp.googlemail.com with ESMTPSA id s1sm484602otd.48.2017.05.11.12.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 12:17:44 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: piglit@lists.freedesktop.org Date: Thu, 11 May 2017 14:17:31 -0500 Message-Id: <1494530251-17160-1-git-send-email-daniel.diaz@linaro.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: baker.dylan.c@gmail.com Subject: [Piglit] [PATCH] 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 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ff99e..136cc21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,10 +141,14 @@ 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(OLD_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} gbm) + 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() + set(CMAKE_REQUIRED_LIBRARIES ${OLD_REQUIRED_LIBRARIES}) + endif(GBM_FOUND) pkg_check_modules(WAYLAND QUIET wayland-client wayland-egl)