OSDN Git Service

Fix the unittests Ninja build.
authorNicolas Capens <capn@google.com>
Fri, 1 Jun 2018 01:05:52 +0000 (21:05 -0400)
committerNicolas Capens <nicolascapens@google.com>
Fri, 1 Jun 2018 15:24:57 +0000 (15:24 +0000)
On Windows, GLAPI defaults to __declspec(dllimport), while GLAPICALL is
empty, leading to declaration mismatches. Either should be empty for
the unit tests since we link statically, for all platforms.

Change-Id: I2dde0ca35108678fd9767895e0120ee4b0d7030f
Reviewed-on: https://swiftshader-review.googlesource.com/19128
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
tests/unittests/BUILD.gn

index 10f5fa5..7cb1cc1 100644 (file)
@@ -31,7 +31,11 @@ test("swiftshader_unittests") {
 
   include_dirs = [ "../../include" ]  # Khronos headers
 
-  defines = [ "GL_GLEXT_PROTOTYPES" ]
+  defines = [
+    "GL_GLEXT_PROTOTYPES",
+    "GL_APICALL=",
+    "GLAPI=",
+  ]
 
   # Make sure we're loading SwiftShader's libraries, not ANGLE's or the system
   # provided ones. On Windows an explicit LoadLibrary("swiftshader\lib*.dll")