Skip to content

OpenGL Program

We can use add_requires to add opengl and glfw dependencies to use OpenGL.

EXPLORER
src
main.cpp
xmake.lua
Lua xmake.lua
12345678910
add_rules("mode.debug", "mode.release")

add_requires("glfw")
add_requires("opengl", {optional = true})

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("glfw", "opengl")
    set_languages("c++11")