diff --git a/modules/gfx/tests/test_gfx_node.cc b/modules/gfx/tests/test_gfx_node.cc
index c32994e10411faa1e99e36400240fe821f5694c1..8a7059f8db459e16d765f634799626fc4d41b214 100644
--- a/modules/gfx/tests/test_gfx_node.cc
+++ b/modules/gfx/tests/test_gfx_node.cc
@@ -39,14 +39,18 @@ using namespace ost::gfx;
 struct GfxTestEnv {
   GfxTestEnv()
   {
+#if defined(__APPLE__)    
     // we know OST_ROOT is set for unit tests
     SetPrefixPath(getenv("OST_ROOT"));
     Scene::Instance().StartOffscreenMode(100, 100);
+#endif
   }
   
   ~GfxTestEnv()
   {
+#if defined(__APPLE__)
     Scene::Instance().StopOffscreenMode();
+#endif
   }
 
 };