diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 585e2aa..78fa61b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + with: + submodules: true - name: Install mamba uses: mamba-org/provision-with-micromamba@v13 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e03d6d8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "glad"] + path = glad + url = https://github.com/Dav1dde/glad.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e17aec8..c1088a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,12 +73,14 @@ option( find_package(xeus-zmq REQUIRED) find_package(PNG REQUIRED) -find_package(glad REQUIRED) find_package(glfw3) find_package(PkgConfig REQUIRED) pkg_check_modules(octinterp REQUIRED IMPORTED_TARGET GLOBAL octinterp) +add_subdirectory(glad/cmake) +glad_add_library(glad-static STATIC API gl:compatibility=1.1) + # Flags ===== include(CheckCXXCompilerFlag) @@ -227,7 +229,7 @@ macro(xeus_octave_create_target target_name linkage output_name) target_link_libraries( ${target_name} PUBLIC xtl PkgConfig::octinterp - PRIVATE glad::glad glfw PNG::PNG + PRIVATE glfw PNG::PNG glad-static ) if(XEUS_OCTAVE_USE_SHARED_XEUS) target_link_libraries(${target_name} PUBLIC xeus-zmq) diff --git a/glad b/glad new file mode 160000 index 0000000..d08b1aa --- /dev/null +++ b/glad @@ -0,0 +1 @@ +Subproject commit d08b1aa01f8fe57498f04d47b5fa8c48725be877 diff --git a/include/xeus-octave/opengl.hpp b/include/xeus-octave/opengl.hpp index 97e3a73..a71526f 100644 --- a/include/xeus-octave/opengl.hpp +++ b/include/xeus-octave/opengl.hpp @@ -26,7 +26,7 @@ #ifndef XEUS_OCTAVE_OPENGL_H #define XEUS_OCTAVE_OPENGL_H -#include +#include namespace octave { diff --git a/src/tk_notebook.cpp b/src/tk_notebook.cpp index b30336f..ac6db3d 100644 --- a/src/tk_notebook.cpp +++ b/src/tk_notebook.cpp @@ -142,7 +142,7 @@ glfw_graphics_toolkit::glfw_graphics_toolkit(std::string const& nm) : octave::ba glfwMakeContextCurrent(window); - gladLoadGLLoader(reinterpret_cast(glfwGetProcAddress)); + gladLoadGL(reinterpret_cast(glfwGetProcAddress)); #ifndef NDEBUG std::clog << "OpenGL vendor: " << glGetString(GL_VENDOR) << '\n';