# Method to identify what backend GLFW is using?

**URL:** <https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582>\
**Category:** support\
**Created:** [June 9, 2020, 7:43am UTC](https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582 "2020-06-09T07:43:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexa-griffin](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/alexa-griffin/32/354_2.png) [@alexa-griffin](https://discourse.glfw.org/u/alexa-griffin)\
**Post date:** [June 9, 2020, 7:43am UTC](https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582/1 "2020-06-09T07:43:00Z")

</div>

I’m currently trying to utilize the functions found [in the native access api for glfw](https://www.glfw.org/docs/latest/group__native.html), but there doesn’t seem to be a way to check what backend glfw is actually using, at first i thought `_GLFW_<platform>`, ex `_GLFW_X11` would be it, but it seems to be undefed at some point. Thanks in advace.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [June 10, 2020, 12:47pm UTC](https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582/2 "2020-06-10T12:47:23Z")

</div>

There’s no platform specific definition exposed in the GLFW header, you’re meant to set up your build system to handle this yourself. The logic GLFW uses in cmake is relatively straight forward:

> <https://github.com/glfw/glfw/blob/master/CMakeLists.txt#L133-L153>

---

<div class="post-metadata">

**Author:** ![alexa-griffin](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/alexa-griffin/32/354_2.png) [@alexa-griffin](https://discourse.glfw.org/u/alexa-griffin)\
**Post date:** [June 11, 2020, 2:27am UTC](https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582/3 "2020-06-11T02:27:17Z")

</div>

Thanks, this was the hotfix I applied but I figured there would be a better way to do it, would you all be open to a pull request that implements this in GLFW itself? Thanks again 🙂

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [June 11, 2020, 10:26am UTC](https://discourse.glfw.org/t/method-to-identify-what-backend-glfw-is-using/1582/4 "2020-06-11T10:26:53Z")

</div>

Contributions are usually welcome - do check out the guidelines first:

> <https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md>
