From patchwork Mon May 15 18:05:21 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: 99831 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1665894qge; Mon, 15 May 2017 11:06:55 -0700 (PDT) X-Received: by 10.99.5.3 with SMTP id 3mr7388294pgf.104.1494871614990; Mon, 15 May 2017 11:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494871614; cv=none; d=google.com; s=arc-20160816; b=mhjmxCtGWPWCRNekJIXF+WLIeYDlgXAo2x56mOW59tGvGIHfUA6itVaLHspjHnHXaM Y4wtkBUmV4iFjiUfC5KrEgkJ3hqPyezTS3EN9r5Mclgf56RXqKOE0g354dH+Db9LVAcQ 02NkyijqhD1iGfWY237RamRs+DMlYmAHBJ+uAXLZ2vwkYjoPy1xD23yZ4V3Lkal7O3C6 yL/zRWzvSQ670x8QbB280EK3zMIc79YYr6ld5astGCJ79UkJbu/lSLTrGoXemy9CxsdI 9XmGDrKINs+EkYoWe9xmtJimss/pbkclz4GTXHKqLWpiFY4a5btjp6K7X0rf4QLTW0L3 Qycg== 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=/HQEIAeNknwlvNBs3vAqk1IoIiqrJIMPDg/Pj8Ltglw=; b=WH/Ada+l5WATurRrLEG5ra53fva6ozS56JLzHsurdFv+QB1b1htgitNy94ww4udTcT b6HesXdFCOD+Fp4fC4GixMEKDWVzP95TaKrYM/ZOgVWkVbl/Xdlmv6bLxi3kvrXvIEkN vwDLVwuFMxPVL1OymhH8qhhyoN9z+cSrnqS+L9CXIT6q+jQKoe1uaeAN+7/nOmNpD8rL gd7iwwwDnGNg4B3B24PQf5xBb5aa03RHjyjSP8Wp3rnMSYEfAKELh8hJzipSh+/1dXPZ fYgWYDSkHHIPOJm42P37DazeDdLrVEhlsZpbSQbz15KLLyFpwgEJFFyipOScsMBJLjBm 1YyA== 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 r5si11252922pfi.203.2017.05.15.11.06.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 11:06:54 -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 22F946E268; Mon, 15 May 2017 18:06:24 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF7DB6E268 for ; Mon, 15 May 2017 18:06:22 +0000 (UTC) Received: by mail-oi0-x236.google.com with SMTP id h4so140440075oib.3 for ; Mon, 15 May 2017 11:06:22 -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=3xbmAwdyYK0PMuruvrxPTJ+k+tJT4gMolczZxzBO5Ds=; b=LDqY9odjk63qoxmmJQbhCMqr/cBfOKe0bLPSbC52s61m1C4Yv+FDUnhMcJ1CqlVjzs EDXZRg4yH1Cgh9g7LBVGmhmIQRdFqL4Yn6eBViReiOzlrtZfoEjRhfYMzPaSfhlqd3pW Vtug1EQWITd985aMngAbCIj+luRl+bNSnaIRQ= 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=3xbmAwdyYK0PMuruvrxPTJ+k+tJT4gMolczZxzBO5Ds=; b=DRVopqm/qamhi2XC6+MDVeI1Z2JRsoYcQDN06jd71Ut3q9H9wUA/tKMYBLrJzrtbXT pSP88M0Lv5P8PqTVSVsd13JYkGUsMxFU5NTjqc7jjnYfZYWXVIMlfKTAekxO32i7acJc R2EX23bt+g9Wv1QJ8jpYtm+/IJF4YAZPiLgS6A143sYc4VCEkp9eYGDw884x6DqczjsT pso9R71lyKGIvDevA00wYhaxQ2IqnRiYPaomSglQtLVHy6EwNzKAXHJ8KdRt2g2SKO6F YNz1WzuZjb9mw8QJvdflvDwz/Bbe/+yr5BFSH93FCWhPWUPvfdaqu+VjWZ2HbVhcBaap CsyA== X-Gm-Message-State: AODbwcCIJub5sw5Peab+IytG0DU1G0QvCZ71SZmCIIMiWq2u7kIMOJ5Y wsN90WyIvJE7hkLm X-Received: by 10.157.60.176 with SMTP id z45mr3110880otc.253.1494871582280; Mon, 15 May 2017 11:06:22 -0700 (PDT) Received: from aura.cortijodelrio.net (CableLink67-82.telefonia.InterCable.net. [201.172.67.82]) by smtp.googlemail.com with ESMTPSA id b39sm5841820ote.9.2017.05.15.11.06.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 11:06:21 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: piglit@lists.freedesktop.org Date: Mon, 15 May 2017 13:05:21 -0500 Message-Id: <1494871521-14389-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 v2] 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 --- v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ff99e..274490f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,8 @@ 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) + CHECK_SYMBOL_EXISTS(gbm_bo_map GBM_HEADERS PIGLIT_HAS_GBM_BO_MAP) + if (PIGLIT_HAS_GBM_BO_MAP) add_definitions(-DPIGLIT_HAS_GBM_BO_MAP) endif() endif(GBM_FOUND)