Skip to content

Commit

Permalink
Merge pull request #118 from nmwsharp/gl-link-fixes
Browse files Browse the repository at this point in the history
openGL linking & shared builds
  • Loading branch information
nmwsharp authored Aug 14, 2021
2 parents 6b3cc34 + 8a513e1 commit 56b82cd
Show file tree
Hide file tree
Showing 16 changed files with 835 additions and 1,756 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
steps:
Expand All @@ -29,3 +29,26 @@ jobs:

- name: run test
run: cd test/build && ./bin/polyscope-test --gtest_catch_exceptions=0 backend=openGL_mock

build_shared:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: install packages
run: sudo apt-get update && sudo apt-get install -y xorg-dev libglu1-mesa-dev xpra xserver-xorg-video-dummy freeglut3-dev

- name: configure
run: cd test && mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug -DPOLYSCOPE_BACKEND_OPENGL3_GLFW=ON -DPOLYSCOPE_BACKEND_OPENGL_MOCK=ON ..

- name: build
run: cd test/build && make

- name: run test
run: cd test/build && ./bin/polyscope-test --gtest_catch_exceptions=0 backend=openGL_mock
17 changes: 17 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,20 @@ jobs:

- name: run test
run: cd test/build && ./bin/polyscope-test --gtest_catch_exceptions=0 backend=openGL_mock

build_shared:
runs-on: macos-latest
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: configure
run: cd test && mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug -DPOLYSCOPE_BACKEND_OPENGL3_GLFW=ON -DPOLYSCOPE_BACKEND_OPENGL_MOCK=ON ..

- name: build
run: cd test/build && make

- name: run test
run: cd test/build && ./bin/polyscope-test --gtest_catch_exceptions=0 backend=openGL_mock
18 changes: 18 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,21 @@ jobs:

- name: run test
run: cd test/build && ./bin/Debug/polyscope-test.exe --gtest_catch_exceptions=0 backend=openGL_mock

# windows shared builds: disabled for now
#build_shared:
#runs-on: windows-latest
#if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
#steps:
#- uses: actions/checkout@v1
#with:
#submodules: true

#- name: configure
#run: cd test && mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug -DPOLYSCOPE_BACKEND_OPENGL3_GLFW=ON -DPOLYSCOPE_BACKEND_OPENGL_MOCK=ON ..

#- name: build
#run: cd test/build && cmake --build "."

#- name: run test
#run: cd test/build && ./bin/Debug/polyscope-test.exe --gtest_catch_exceptions=0 backend=openGL_mock
29 changes: 17 additions & 12 deletions deps/glad/include/KHR/khrplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __khrplatform_h_

/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
Expand All @@ -26,18 +26,16 @@

/* Khronos platform-specific types and definitions.
*
* $Revision: 32517 $ on $Date: 2016-03-11 02:41:19 -0800 (Fri, 11 Mar 2016) $
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
Expand Down Expand Up @@ -92,18 +90,25 @@
* int arg2) KHRONOS_APIATTRIBUTES;
*/

#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif

/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# include <sys/cdefs.h>
# define KHRONOS_APICALL __attribute__((visibility("default"))) __NDK_FPABI__
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
Expand Down
Loading

0 comments on commit 56b82cd

Please sign in to comment.