From patchwork Wed May 17 00:06:40 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: 99897 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp2263710qge; Tue, 16 May 2017 17:07:16 -0700 (PDT) X-Received: by 10.98.85.6 with SMTP id j6mr668632pfb.31.1494979636145; Tue, 16 May 2017 17:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494979636; cv=none; d=google.com; s=arc-20160816; b=xTNUeCBz5+Zhr+ptpTz7sU2zPdVStREQ7vBy7ldJ7VO6wt3pJSe17M3FrervOGxxjf uriPTsN1dBwyGEAiC3OMBjpGpmVyPcRGCuAiqb7G6aLORO3rxLCVSvyRyDx/Js8CTDuf wFmlgTmZrgsjNQ+iz0FiN17ioPlYA1Fj2+gt054Che5W7HpRwjgWEaW/Q3B4r8Gey7ec ukfagjzEMWZ41+jIkLT2opZYdoMRANEKLPqGxBKMM8QlKSszj/eTWUjiFO4tJcQ8buQ9 WlHQymVW++xZ7JMj4b8mdqBMd3ubbWMsw7Ub9ZjXyUNjmih1rJfspVeKGdN+KNq7Gjls 9YeA== 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=A7oa+K4EJD/Q7VLwsQerVNn36WNU3WyRRlPgWW6VCZ0=; b=FL3Ut4MzsPhtds/v+3qbykdbThgft/mnmE35/pxSrlr9WfWw17jq5oGVSwCoN8Jfan p2TQ84dG579SeEb+MJGyqDUVU7c4qXqa1e+7mrJqaWjXzpQNdEB0+jKAwK4JCRjrnfiU 4LXszK2mW6jpVPFbDMlr+yaV2UAoilxMUceIRvDurrBeIZ0vpYnEYg3QGpU7D9Pp9Yxh Jsb/oa80P7mC8h2Fx0uLuKWBaz8HNL+yAyvwgoh9I1dy5GZ1Td5SYNz8CpH5P+2Z2jZw OR/9kqOJf3T2JuOPZ2VmYgUaTxkelHX6sNVWBv4skf+H27puHNTxrSRflabgHsDcoICV pN9A== 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 m22si355697pgd.223.2017.05.16.17.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 17:07:16 -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 8392A6E37D; Wed, 17 May 2017 00:07:15 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id B79466E37B for ; Wed, 17 May 2017 00:07:13 +0000 (UTC) Received: by mail-oi0-x229.google.com with SMTP id b204so45655900oii.1 for ; Tue, 16 May 2017 17:07:13 -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=bSlMXnTn6JEO4JQ0V0hl8Kj6sB03GBjeFULaP67U/2E=; b=HFAvPNVmEFQkqOqJSE+1i6mHsl49QmX9yEB8D1ePcz33sVzVL9UupyjLll9/77V48P GruEa+qrTdgDAGKMVCJNCR7Nx4OU7pW/ch8xg+sFUvUA38JlpdPXVWJCTpuByaWMDIBV M2+dF7hrJ2LIDz2jH3uBOdHA7L8onzrjrsYuE= 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=bSlMXnTn6JEO4JQ0V0hl8Kj6sB03GBjeFULaP67U/2E=; b=AszgOZsT6xEJY8J6vW/QuzBu21cBhRuQbYaTKH1GFSKdljJPKIuc6IveGYFEihAoAQ 5NQH3zP56W9IeBKHt8KB8P2qeZWfRzzymf+JJ0diQESHl0QFd4QhQUpxITpqvs5Ky1e7 HanSm/wogiTMOkKNuNCFXAdqFtF251Oq5OCw+z9x1S49gUj1jn1okMk4JtjarIXch46b i4QpfFYwOua2hIaivDWELAWGEO3+YrjAgleUdnz9bu9u50yHvVHN+twpVh70hB2qOQAb b7z7ueq5coYrurX9SrNXnt7BG79ALig1NEZVQoKFuvJuqd4BZkz7jE83XQm4hidiSFzc Brlg== X-Gm-Message-State: AODbwcCAt65i4cSR12+ka+83ga/CzLXflBOMUP11E9RkHcBqTIEfgTQT VzoTS1xyVl2nAQjU X-Received: by 10.157.10.134 with SMTP id 6mr415706otq.107.1494979632874; Tue, 16 May 2017 17:07:12 -0700 (PDT) Received: from aura.cortijodelrio.net ([201.172.67.82]) by smtp.googlemail.com with ESMTPSA id f81sm217639oih.1.2017.05.16.17.07.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 May 2017 17:07:12 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: piglit@lists.freedesktop.org Date: Tue, 16 May 2017 19:06:40 -0500 Message-Id: <1494979600-32499-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 v5] 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'. v5: Add reviewed-by; hopefully final version. 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)