From patchwork Mon May 15 23:54:03 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: 99837 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1775306qge; Mon, 15 May 2017 16:54:43 -0700 (PDT) X-Received: by 10.84.176.131 with SMTP id v3mr11817296plb.138.1494892483887; Mon, 15 May 2017 16:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494892483; cv=none; d=google.com; s=arc-20160816; b=CxHAblk4v7VbiwgofADskTxcufBZ4cgh7fYoKvqhG+cWZMGOrkPvGlXpkBgdNHJkjK qlWM+NTtclDDCcI6rbMHNDj7it3J+MJzjXYjgt2dcm67wWMxBhBpaIdmfv6Niagd5jvO dUNhOnc6nsf+etceflo5eW/+Brq+mKbvs+T4Es4ftZf1V5f4JE4rBiabkgqbp3nX79C+ lcFzHaAmYN2lDoSEjfF5i+Oqb9m8FMZJY5FZHc3WoQTch2h1QLKWn8HrXKt7XiRf3Lzg oaA9WIrrzus0NHX0hU8Gscwcr6cuMPjRfZC4rWidkQRchBsX5ijOZwNPv0rk2o1sP0UR Q7QA== 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=PQFDrQoZIaHFKadyDSLKwfyvgdzYEhMwL4W6hZa54X8=; b=vbE3ZaxK2N0ZFn/sgCU1GnEJZfH0m29vOzIU8xVbiBQXU6RyYmHG5epr0M2OS7zDPG T9aeC2xvf7UDfBs0h/kR+SZ8F7rjZ1mpd5Dqs1Tb/B9QUQooeG475B5uWa8mnycbL0Us blV0fszNQhd8ZdDvbQDg18o5C9D0Xbob/c2SHXF875nfwfJSF+DMMp/gP/mjrxr3bHqa cIMHve+FOu1RHB6ElJ0x3vRuSzUc0MPWLXTFmwirbfFZEbr/d2E3KA9G+UTfawa7Q5y2 GJxU77iqkWFkDvsz5vG8KCiIf3sWP+AASfM7URJH6OCirIaAvn8UOeYcgVh+b2MMvD9u fy+g== 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 w126si12144399pgb.395.2017.05.15.16.54.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 16:54:43 -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 6384189F38; Mon, 15 May 2017 23:54:43 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E32D89F38 for ; Mon, 15 May 2017 23:54:42 +0000 (UTC) Received: by mail-oi0-x235.google.com with SMTP id h4so6430143oib.3 for ; Mon, 15 May 2017 16:54:42 -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=Ud4CoULCnnKG5yw4y9aCHKJerbReHUnLYdWSyCJlQ1I=; b=EIt2EvyDFgSBSbsTiriJOmyuTBH5CzkqtX8bq2408/z017SjDCDrQkENNa9nJ6jqIw FJU7KzETWKj9WRy3ap9Bwyd52lAnxNw0qVU8gO285g5Trpb9p1ww/3Myph9+3jQAfcYq G9z65nrKuMfkIkNzw7IniQz0Z7pd9y8bf8npM= 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=Ud4CoULCnnKG5yw4y9aCHKJerbReHUnLYdWSyCJlQ1I=; b=mHsbPuwhtXBjt8KNHeWXLvOAsGgqAKzfA4wwSljaoVQAEEgvk/gymd72ofYNmGswOm cqLv2UJti9HemBGoE8d5SWbEq0ZI/0cLvyCfnlbM0yekwO3Tduj341LqxdQ8/boqP91l pzZkSqcO/4dSzzuGNvoab6QanSURsZPEzMd1OcUBBFNm+pkqC1L4mMantyl8J4PbTpoH vZrpTn3lEtMTqjkT2IdYGun8diQeDBdYJZorQV4WwN3j4QqPCqDUUZWMi7Sncbo3D1TG Rz4X0pkF7Mu6sPMkUnIFxqUnpkkULQ2tcJXrhKz9gIQ3FvREXWmW5yvhzvLmqIsr/uUl v1/Q== X-Gm-Message-State: AODbwcCSMud0G9mVc5Tn6pU9cE1u/fHSo0whS8KvCp9N+9jtpPZfkxV7 6goRVxkXLcHgX7ar X-Received: by 10.157.38.200 with SMTP id i8mr4837808otd.25.1494892481236; Mon, 15 May 2017 16:54:41 -0700 (PDT) Received: from aura.cortijodelrio.net (CableLink67-82.telefonia.InterCable.net. [201.172.67.82]) by smtp.googlemail.com with ESMTPSA id z30sm6059648ota.1.2017.05.15.16.54.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 May 2017 16:54:40 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: piglit@lists.freedesktop.org Date: Mon, 15 May 2017 18:54:03 -0500 Message-Id: <1494892443-9912-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 v3] 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. v3: Back to CHECK_FUNCTION_EXISTS. CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ff99e..b9e5050 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) + 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)