From 282195b450721a5b8ad0cea8e66606b2661fe888 Mon Sep 17 00:00:00 2001
From: wwylele <wwylele@gmail.com>
Date: Sat, 19 Nov 2016 17:16:34 +0200
Subject: [PATCH] tests: add a work-around for macOS linking error

---
 src/tests/CMakeLists.txt |  1 +
 src/tests/glad.cpp       | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 src/tests/glad.cpp

diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 47799e1c2..89237e477 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -1,4 +1,5 @@
 set(SRCS
+            glad.cpp
             tests.cpp
             core/file_sys/path_parser.cpp
             )
diff --git a/src/tests/glad.cpp b/src/tests/glad.cpp
new file mode 100644
index 000000000..b0b016440
--- /dev/null
+++ b/src/tests/glad.cpp
@@ -0,0 +1,14 @@
+// Copyright 2016 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <catch.hpp>
+#include <glad/glad.h>
+
+// This is not an actual test, but a work-around for issue #2183.
+// If tests uses functions in core but doesn't explicitly use functions in glad, the linker of macOS
+// will error about undefined references from video_core to glad. So we explicitly use a glad
+// function here to shut up the linker.
+TEST_CASE("glad fake test", "[dummy]") {
+    REQUIRE(&gladLoadGL != nullptr);
+}