Browse Source

When building with Mono we need a few references

Josh Engebretson 10 years ago
parent
commit
9f19136359

+ 15 - 1
Source/ToolCore/NETTools/NETProjectGen.cpp

@@ -261,6 +261,15 @@ bool NETCSProject::Load(const JSONValue& root)
         references_.Push(reference);
         references_.Push(reference);
     }
     }
 
 
+    // msvc doesn't like including these
+    if (projectGen_->GetMonoBuild())
+    {
+        references_.Push("System.Console");
+        references_.Push("System.IO");
+        references_.Push("System.IO.FileSystem");
+
+    }
+
     const JSONArray& sources = root["sources"].GetArray();
     const JSONArray& sources = root["sources"].GetArray();
 
 
     for (unsigned i = 0; i < sources.Size(); i++)
     for (unsigned i = 0; i < sources.Size(); i++)
@@ -353,9 +362,14 @@ bool NETSolution::Load(const JSONValue& root)
     return true;
     return true;
 }
 }
 
 
-NETProjectGen::NETProjectGen(Context* context) : Object(context)
+NETProjectGen::NETProjectGen(Context* context) : Object(context),
+    monoBuild_(false)
 {
 {
 
 
+#ifndef ATOMIC_PLATFORM_WINDOWS
+    monoBuild_ = true;
+#endif
+
 }
 }
 
 
 NETProjectGen::~NETProjectGen()
 NETProjectGen::~NETProjectGen()

+ 4 - 0
Source/ToolCore/NETTools/NETProjectGen.h

@@ -112,6 +112,8 @@ public:
     const String& GetScriptPlatform() { return scriptPlatform_; }
     const String& GetScriptPlatform() { return scriptPlatform_; }
 
 
     NETSolution* GetSolution() { return solution_; }
     NETSolution* GetSolution() { return solution_; }
+    bool GetMonoBuild() { return monoBuild_; }
+
     const Vector<SharedPtr<NETCSProject>>& GetCSProjects() { return projects_; }
     const Vector<SharedPtr<NETCSProject>>& GetCSProjects() { return projects_; }
 
 
     void SetScriptPlatform(const String& platform) { scriptPlatform_ = platform; }
     void SetScriptPlatform(const String& platform) { scriptPlatform_ = platform; }
@@ -125,6 +127,8 @@ private:
 
 
     String scriptPlatform_;
     String scriptPlatform_;
 
 
+    bool monoBuild_;
+
     SharedPtr<NETSolution> solution_;
     SharedPtr<NETSolution> solution_;
     Vector<SharedPtr<NETCSProject>> projects_;
     Vector<SharedPtr<NETCSProject>> projects_;