diff options
-rw-r--r-- | .appveyor.yml | 67 | ||||
-rwxr-xr-x | .github/scripts/epoxy-ci-linux.sh (renamed from .travis/epoxy-ci-linux.sh) | 0 | ||||
-rwxr-xr-x | .github/scripts/epoxy-ci-osx.sh (renamed from .travis/epoxy-ci-osx.sh) | 0 | ||||
-rw-r--r-- | .github/workflows/linux.yml (renamed from .github/workflows/ci.yml) | 16 | ||||
-rw-r--r-- | .github/workflows/macos.yml | 26 | ||||
-rw-r--r-- | .github/workflows/msvc-env.yml | 23 | ||||
-rw-r--r-- | .github/workflows/msys2.yml | 27 | ||||
-rw-r--r-- | .travis.yml | 55 | ||||
-rw-r--r-- | .travis/Dockerfile | 29 | ||||
-rwxr-xr-x | .travis/run-docker.sh | 12 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | src/dispatch_common.c | 10 | ||||
-rwxr-xr-x | src/gen_dispatch.py | 10 | ||||
-rw-r--r-- | src/meson.build | 13 |
15 files changed, 112 insertions, 187 deletions
diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 8e0cae2..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: 1.0.{build} - -image: Visual Studio 2015 - -configuration: Release - -# Configure both 32-bit and 64-bit builds -environment: - matrix: - - platform: x86 - config: Win32 - pout: x86 - - platform: x64 - config: x64 - pout: x64 - -shallow_clone: true - -# Download Meson and Ninja, create install directory -before_build: -- mkdir build -- mkdir libepoxy-shared-%pout% -- cd build -- curl -LsSO https://github.com/mesonbuild/meson/releases/download/0.47.1/meson-0.47.1.tar.gz -- 7z x meson-0.47.1.tar.gz -- move dist\meson-0.47.1.tar . -- 7z x meson-0.47.1.tar -- rmdir dist -- del meson-0.47.1.tar meson-0.47.1.tar.gz -- curl -LsSO https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip -- 7z x ninja-win.zip -- del ninja-win.zip -- cd .. - -# Build and install -build_script: -- cd build -- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% -- C:\Python36\python.exe meson-0.47.1\meson.py .. . --backend=ninja --prefix=%APPVEYOR_BUILD_FOLDER%\libepoxy-shared-%pout% -- ninja -- ninja install -- cd .. - -# Copy license into install directory and create .zip file -after_build: -- copy COPYING libepoxy-shared-%pout% -- dir libepoxy-shared-%pout% /s /b -- 7z a -tzip libepoxy-shared-%pout%.zip libepoxy-shared-%pout% - -artifacts: - - path: libepoxy-shared-%pout%.zip - name: libepoxy-shared-%pout% - -test: off - -# Upload .zip file to GitHub release -deploy: - release: $(APPVEYOR_REPO_TAG_NAME) - description: "Epoxy $(APPVEYOR_REPO_TAG_NAME)" - provider: GitHub - auth_token: - secure: X7Ro8Y2RWYo/M1AAn93f9X0dEQFvu7gPb6li2eKRtzPYLGj/JKm7MNWRw2cCcjm6 - artifact: libepoxy-shared-$(pout) - draft: false - prerelease: false - on: - appveyor_repo_tag: true # deploy on tag push only diff --git a/.travis/epoxy-ci-linux.sh b/.github/scripts/epoxy-ci-linux.sh index e95584f..e95584f 100755 --- a/.travis/epoxy-ci-linux.sh +++ b/.github/scripts/epoxy-ci-linux.sh diff --git a/.travis/epoxy-ci-osx.sh b/.github/scripts/epoxy-ci-osx.sh index 1a062a1..1a062a1 100755 --- a/.travis/epoxy-ci-osx.sh +++ b/.github/scripts/epoxy-ci-osx.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/linux.yml index edd6c5b..3d71e7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: Build +name: Ubuntu on: push: branches-ignore: @@ -10,7 +10,6 @@ jobs: matrix: os: - ubuntu-18.04 - - macos-10.15 compiler: - gcc - clang @@ -19,16 +18,10 @@ jobs: - '-Dglx=no' - '-Degl=no' - '-Dx11=false' - exclude: - - os: macos-10.15 - compiler: gcc runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - if: runner.os == 'macOS' - run: brew install ninja - - if: runner.os == 'Linux' - run: > + - run: > sudo apt-get update && sudo apt-get install --no-install-recommends libgl1-mesa-dev @@ -42,7 +35,4 @@ jobs: - run: | python -m pip install --upgrade pip pip3 install meson - - if: runner.os == 'macOS' - run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-osx.sh ${{ matrix.build-opts }}" - - if: runner.os == 'Linux' - run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-linux.sh ${{ matrix.build-opts }}" + /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-linux.sh ${{ matrix.build-opts }}" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..c725ef1 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,26 @@ +name: macOS +on: + push: + branches-ignore: + - debian + - khronos-registry +jobs: + build: + strategy: + matrix: + build-opts: + - '' + - '-Dglx=no' + - '-Degl=no' + - '-Dx11=false' + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: | + brew install ninja + python -m pip install --upgrade pip + pip3 install meson + /bin/sh -c "CC=clang .github/scripts/epoxy-ci-osx.sh ${{ matrix.build-opts }}" diff --git a/.github/workflows/msvc-env.yml b/.github/workflows/msvc-env.yml new file mode 100644 index 0000000..a4e69c8 --- /dev/null +++ b/.github/workflows/msvc-env.yml @@ -0,0 +1,23 @@ +name: MSVC Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + env: + PYTHONIOENCODING: "utf-8" + steps: + - uses: actions/checkout@master + - uses: actions/setup-python@v1 + - uses: seanmiddleditch/gha-setup-vsdevenv@master + - uses: BSFishy/meson-build@v1.0.1 + with: + action: test + directory: _build + options: --verbose --fatal-meson-warnings + meson-version: 0.54.3 diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000..0f90a2b --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,27 @@ +name: MSYS2 Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + env: + PYTHONIOENCODING: "utf-8" + steps: + - uses: actions/checkout@master + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: base-devel git mingw-w64-x86_64-meson mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-toolchain + - name: Build + run: | + meson setup _build + meson compile -C _build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0fe6610..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false - -branches: - except: - - debian - - khronos-registry - -os: - - linux - - osx - -compiler: - - gcc - - clang - -language: - - c - -services: - - docker - -matrix: - exclude: - - os: osx - compiler: gcc - -before_install: - - | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew update - brew unlink python@2 - brew install python@3 meson - # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219 - mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja - fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi - -before_script: - - | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - echo FROM ebassi/epoxyci > Dockerfile - echo ADD . /root >> Dockerfile - echo WORKDIR /root >> Dockerfile - docker build -t withgit . - fi - -env: - - BUILD_OPTS="" - - BUILD_OPTS="-Dglx=no" - - BUILD_OPTS="-Degl=no" - - BUILD_OPTS="-Dx11=false" - -script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "CC=$CC .travis/epoxy-ci-linux.sh $BUILD_OPTS" ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/sh -c "CC=$CC .travis/epoxy-ci-osx.sh $BUILD_OPTS" ; fi diff --git a/.travis/Dockerfile b/.travis/Dockerfile deleted file mode 100644 index bd9b40a..0000000 --- a/.travis/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:stretch-slim -MAINTAINER Emmanuele Bassi <ebassi@gmail.com> - -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -qq -y \ - ca-certificates \ - clang \ - gcc \ - libgl1-mesa-dev \ - libegl1-mesa-dev \ - libgles1-mesa-dev \ - libgles2-mesa-dev \ - libgl1-mesa-dri \ - locales \ - ninja-build \ - pkg-config \ - python3 \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - xvfb && \ - rm -rf /usr/share/doc/* /usr/share/man/* - -RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8 -ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 - -RUN pip3 install meson - -WORKDIR /root diff --git a/.travis/run-docker.sh b/.travis/run-docker.sh deleted file mode 100755 index 4b3ecc7..0000000 --- a/.travis/run-docker.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -xe - -srcdir="$(pwd)/.." - -sudo docker build \ - --tag "epoxyci" \ - --file "Dockerfile" . -sudo docker run --rm \ - --volume "${srcdir}:/root/epoxy" \ - --tty --interactive "epoxyci" bash @@ -1,5 +1,8 @@ -[![Build Status](https://travis-ci.org/anholt/libepoxy.svg?branch=master)](https://travis-ci.org/anholt/libepoxy) -[![Build status](https://ci.appveyor.com/api/projects/status/xv6y5jurt5v5ngjx/branch/master?svg=true)](https://ci.appveyor.com/project/ebassi/libepoxy/branch/master) +![Ubuntu](https://github.com/anholt/libepoxy/workflows/Ubuntu/badge.svg) +![macOS](https://github.com/anholt/libepoxy/workflows/macOS/badge.svg) +![MSVC Build](https://github.com/anholt/libepoxy/workflows/MSVC%20Build/badge.svg) +![MSYS2 Build](https://github.com/anholt/libepoxy/workflows/MSYS2%20Build/badge.svg) +[![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) Epoxy is a library for handling OpenGL function pointer management for you. diff --git a/meson.build b/meson.build index c5474e0..ca37e80 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,11 @@ -project('libepoxy', 'c', version: '1.5.5', +project('libepoxy', 'c', version: '1.5.6', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', 'warning_level=1', ], license: 'MIT', - meson_version: '>= 0.48.0') + meson_version: '>= 0.54.0') epoxy_version = meson.project_version().split('.') epoxy_major_version = epoxy_version[0].to_int() diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 9977a02..62b7134 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -674,9 +674,13 @@ epoxy_load_gl(void) if (!api.gl_handle) get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); #endif - - get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); - api.gl_handle = api.glx_handle; + if (!api.gl_handle) { + get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); +#if PLATFORM_HAS_GLX + if (!api.glx_handle) + api.glx_handle = api.gl_handle; +#endif + } #endif } diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index 5115bf0..b686824 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -467,6 +467,7 @@ class Generator(object): func.args_decl)) def write_header_header(self, out_file): + self.close() self.out_file = open(out_file, 'w') self.outln('/* GL dispatch header.') @@ -765,6 +766,7 @@ class Generator(object): self.outln('') def write_source(self, f): + self.close() self.out_file = open(f, 'w') self.outln('/* GL dispatch code.') @@ -857,6 +859,12 @@ class Generator(object): for func in self.sorted_functions: self.write_function_pointer(func) + def close(self): + if self.out_file: + self.out_file.close() + self.out_file = None + + argparser = argparse.ArgumentParser(description='Generate GL dispatch wrappers.') argparser.add_argument('files', metavar='file.xml', nargs='+', help='GL API XML files to be parsed') argparser.add_argument('--outputdir', metavar='dir', required=False, help='Destination directory for files (default to current dir)') @@ -921,3 +929,5 @@ for f in args.files: generator.write_header(os.path.join(includedir, name + '_generated.h')) if build_source: generator.write_source(os.path.join(srcdir, name + '_generated_dispatch.c')) + + generator.close() diff --git a/src/meson.build b/src/meson.build index 881e087..37e28f0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -72,17 +72,22 @@ libepoxy = library( link_args: common_ldflags, ) +epoxy_has_glx = build_glx ? '1' : '0' +epoxy_has_egl = build_egl ? '1' : '0' +epoxy_has_wgl = build_wgl ? '1' : '0' + libepoxy_dep = declare_dependency( link_with: libepoxy, include_directories: libepoxy_inc, dependencies: epoxy_deps, sources: epoxy_headers, + variables: { + 'epoxy_has_glx': epoxy_has_glx, + 'epoxy_has_egl': epoxy_has_egl, + 'epoxy_has_wgl': epoxy_has_wgl, + }, ) -epoxy_has_glx = build_glx ? '1' : '0' -epoxy_has_egl = build_egl ? '1' : '0' -epoxy_has_wgl = build_wgl ? '1' : '0' - # We don't want to add these dependencies to the library, as they are # not needed when building Epoxy; we do want to add them to the generated # pkg-config file, for consumers of Epoxy |