ide/Project: Added buildBitDepth member to ProjectOptions so 32 or 64 bit is optional...
authorJerome St-Louis <jerome@ecere.com>
Mon, 23 Apr 2012 20:36:03 +0000 (16:36 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 23 Apr 2012 20:36:03 +0000 (16:36 -0400)
ide/ide.epj
ide/src/project/Project.ec
ide/src/project/ProjectConfig.ec

index 4cb4dfe..0ca126e 100644 (file)
       {
          "Folder" : "licenses",
          "Files" : [
-
-         ]
-      },
-      {
-         "Folder" : "licenses",
-         "Files" : [
             "../LICENSE",
             "../extras/res/licenses/png.LICENSE",
             "../extras/res/licenses/tango.COPYING",
index 85b27df..1575e72 100644 (file)
@@ -1894,6 +1894,8 @@ private:
          char fixedConfigName[MAX_FILENAME];
          char fixedCompilerName[MAX_FILENAME];
          int c, len;
+         // Non-zero if we're building eC code
+         // We'll have to be careful with this when merging configs where eC files can be excluded in some configs and included in others
          int numCObjects = 0;
          bool sameObjTargetDirs;
          DirExpression objDirExp = GetObjDir(compiler, config);
@@ -1908,6 +1910,7 @@ private:
          Array<String> listItems { };
          Map<String, int> varStringLenDiffs { };
          Map<String, NameCollisionInfo> namesInfo { };
+         bool forceBitDepth = false;
 
          ReplaceSpaces(objDirNoSpaces, objDirExp.dir);
          strcpy(targetDir, GetTargetDirExpression(compiler, config));
@@ -2242,7 +2245,9 @@ private:
          {
             f.Printf(" -fmessage-length=0 $(OPTIMIZE)");
             //if(compiler.targetPlatform.is32Bits)
-               f.Printf(" -m32");
+            forceBitDepth = (options && options.buildBitDepth) || numCObjects;
+            if(forceBitDepth)
+               f.Printf((!options || !options.buildBitDepth || options.buildBitDepth == bits32) ? " -m32" : " -m64");
             //else if(compiler.targetPlatform.is64Bits)
             //   f.Printf(" -m64");
             f.Printf(" $(FPIC)");
@@ -2292,7 +2297,9 @@ private:
 
          f.Printf("OFLAGS +=\n");
          f.Printf("ifneq \"$(TARGET_TYPE)\" \"%s\"\n", TargetTypeToMakefileVariable(staticLibrary));
-         f.Printf("OFLAGS += -m32");
+         if(forceBitDepth)
+            f.Printf((!options || !options.buildBitDepth || options.buildBitDepth == bits32) ? "OFLAGS += -m32" : "OFLAGS += -m64");
+
          if(GetProfile(config))
             f.Printf(" -pg");
          if(config && config.options && config.options.libraryDirs)
index e558307..a63b139 100644 (file)
@@ -177,6 +177,7 @@ class DirExpression : struct
 public enum TargetTypes { unset, executable, sharedLibrary, staticLibrary };
 public enum OptimizationStrategy { unset, none, speed, size };
 public enum WarningsOption { unset, normal, none, all }; // TOCHECK: More options?
+public enum BuildBitDepth { all, bits32, bits64 };
 
 Array<String> CopyArrayString(Array<String> array)
 {
@@ -282,6 +283,7 @@ public:
    SetBool compress;
 
    SetBool excludeFromBuild;
+   BuildBitDepth buildBitDepth;
 
    property Array<String> prebuildCommands
    {