From 54685091f1bb98b9fcf45085031c9fa19caf7899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sun, 20 Jan 2019 11:36:56 +0100 Subject: [PATCH] cogl-path: Remove own glu.h version cogl-path uses types from glu.h, but to avoid a build dependency on glu, it kept a minified copy of glu.h in tree. Drop this file and just use the actual glu.h. To avoid linking to libGLU.so, just use the includepath, instead of actually adding glu as a real dependency. This means we can remove an includepath meant to make it possible to include . --- .gitlab-ci/Dockerfile | 2 +- cogl/cogl-path/meson.build | 10 +++++-- cogl/cogl-path/tesselator/GL/glu.h | 47 ------------------------------ meson.build | 1 + 4 files changed, 9 insertions(+), 51 deletions(-) delete mode 100644 cogl/cogl-path/tesselator/GL/glu.h diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile index dafa5ac24..f755b126c 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/Dockerfile @@ -5,7 +5,7 @@ RUN dnf -y update && dnf -y upgrade && \ dnf builddep -y mutter && \ # Until Fedora catches up with meson build-deps - dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \ + dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland mesa-libGLU-devel && \ # For running unit tests dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \ diff --git a/cogl/cogl-path/meson.build b/cogl/cogl-path/meson.build index 03b09a58d..37cd18fc4 100644 --- a/cogl/cogl-path/meson.build +++ b/cogl/cogl-path/meson.build @@ -33,10 +33,9 @@ cogl_path_sources = [ 'tesselator/tesselator.h', 'tesselator/tessmono.c', 'tesselator/tessmono.h', - 'tesselator/GL/glu.h', ] -cogl_path_includepath = include_directories('.', 'tesselator') +cogl_path_includepath = include_directories('.') libmutter_cogl_path_enum_types = gnome.mkenums('cogl-path-enum-types', sources: 'cogl-path-types.h', @@ -49,10 +48,15 @@ libmutter_cogl_path_enum_types_h = libmutter_cogl_path_enum_types[1] cogl_path_sources += libmutter_cogl_path_enum_types +cogl_path_c_args = [ + cogl_c_args, + '-I@0@'.format(glu_dep.get_pkgconfig_variable('includedir')), +] + libmutter_cogl_path = shared_library('mutter-cogl-path-' + libmutter_api_version, sources: [cogl_path_sources, cogl_path_public_headers], soversion: '0.0.0', - c_args: cogl_c_args, + c_args: cogl_path_c_args, include_directories: [cogl_includepath, cogl_path_includepath], link_depends: 'libmutter-cogl-path.map', dependencies: [libmutter_cogl_dep, cogl_deps], diff --git a/cogl/cogl-path/tesselator/GL/glu.h b/cogl/cogl-path/tesselator/GL/glu.h deleted file mode 100644 index 18c4024b7..000000000 --- a/cogl/cogl-path/tesselator/GL/glu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Cogl - * - * A Low Level GPU Graphics and Utilities API - * - * Copyright (C) 2010 Intel Corporation. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -/* This is just a wrapper to use our simplified version of glu.h so - that the tesselator code can still #include */ - -#include "../tesselator.h" - -/* These aren't defined on GLES and we don't really want the - tesselator code to use them but we're also trying to avoid - modifying the C files so we just force them to be empty here */ - -#undef GLAPI -#define GLAPI - -#undef GLAPIENTRY -#define GLAPIENTRY - -/* GLES doesn't define a GLdouble type so lets just force it to a - regular double */ -#define GLdouble double diff --git a/meson.build b/meson.build index be1b829a3..0c021fb09 100644 --- a/meson.build +++ b/meson.build @@ -120,6 +120,7 @@ xinerama_dep = dependency('xinerama') ice_dep = dependency('ice') atk_dep = dependency('atk', version: atk_req) libcanberra_dep = dependency('libcanberra', version: libcanberra_req) +glu_dep = dependency('glu') # For now always require X11 support have_x11 = true