ide; added fast math option to ProjectSettings dialog and equal to optimize functiona...
authorRejean Loyer <rejean.loyer@gmail.com>
Wed, 24 Oct 2012 10:31:03 +0000 (06:31 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Wed, 24 Oct 2012 10:36:18 +0000 (06:36 -0400)
ide/src/ProjectSettings.ec
ide/src/dialogs/NewProjectDialog.ec
ide/src/project/Project.ec
ide/src/project/ProjectConfig.ec

index 9ab4140..e991945 100644 (file)
@@ -1936,10 +1936,16 @@ class CompilerTab : Tab
    };
    BoolOptionBox strictNameSpaces
    {
-      rightPane, this, position = { 172, 112 }, 
+      rightPane, this, position = { 172, 112 },
       text = $"Strict Name Spaces", option = OPTION(strictNameSpaces);
    };
 
+   BoolOptionBox fastMath
+   {
+      rightPane, this, position = { 316, 112 },
+      text = $"Fast Math", option = OPTION(fastMath);
+   };
+
    BoolOptionBox memoryGuard
    {
       rightPane, this, position = { 8, 154 };
index cb971c0..9ed169d 100644 (file)
@@ -96,6 +96,7 @@ class NewProjectDialog : Window
             options =
             {
                optimization = speed;
+               fastMath = true;
                debug = false;
             };
             makingModified = true;
@@ -403,6 +404,7 @@ class QuickProjectDialog : Window
             options =
             {
                optimization = speed;
+               fastMath = true;
                debug = false;
             };
             makingModified = true;
index 8448a66..b04ee40 100644 (file)
@@ -625,6 +625,9 @@ define localProfile = config && config.options && config.options.profile ?
 define localOptimization = config && config.options && config.options.optimization ?
             config.options.optimization : options && options.optimization ?
             options.optimization : OptimizationStrategy::none;
+define localFastMath = config && config.options && config.options.fastMath ?
+            config.options.fastMath : options && options.fastMath ?
+            options.fastMath : SetBool::unset;
 define localDefaultNameSpace = config && config.options && config.options.defaultNameSpace ?
             config.options.defaultNameSpace : options && options.defaultNameSpace ?
             options.defaultNameSpace : null;
@@ -987,6 +990,12 @@ private:
       return optimization;
    }
 
+   bool GetFastMath(ProjectConfig config)
+   {
+      SetBool fastMath = localFastMath;
+      return fastMath == true;
+   }
+
    String GetDefaultNameSpace(ProjectConfig config)
    {
       String defaultNameSpace = localDefaultNameSpace;
@@ -2224,12 +2233,13 @@ private:
          {
             case speed:
                f.Printf(" -O2");
-               f.Printf(" -ffast-math");
                break;
             case size:
                f.Printf(" -Os");
                break;
          }
+         if(GetFastMath(config))
+            f.Printf(" -ffast-math");
          if(GetDebug(config))
             f.Printf(" -g");
          f.Printf("\n");
index ea60d52..2154604 100644 (file)
@@ -275,6 +275,7 @@ public:
 
    SetBool excludeFromBuild;
    BuildBitDepth buildBitDepth;
+   SetBool fastMath;
 
    property Array<String> prebuildCommands
    {
@@ -339,6 +340,7 @@ public:
          console = console,
          compress = compress,
          excludeFromBuild = excludeFromBuild,
+         fastMath = fastMath,
          preprocessorDefinitions = CopyArrayString(preprocessorDefinitions),
          includeDirs = CopyArrayString(includeDirs),
          libraries = CopyArrayString(libraries),