ide: add 'force single job compiling' checkbox to the toolbar.
[sdk] / ide / src / project / Project.ec
index fc030a9..613b298 100644 (file)
@@ -680,7 +680,7 @@ CompilerConfig GetCompilerConfig()
 #ifndef MAKEFILE_GENERATOR
    CompilerConfig compiler = null;
    if(ide && ide.workspace)
-      compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      compiler = ideSettings.GetCompilerConfig(ide.workspace.activeCompiler);
    return compiler;
 #else
    incref defaultCompiler;
@@ -934,7 +934,7 @@ private:
 
                if(projectView)
                {
-                  CompilerConfig compiler = ideSettings.GetCompilerConfig(projectView.workspace.compiler);
+                  CompilerConfig compiler = ideSettings.GetCompilerConfig(projectView.workspace.activeCompiler);
                   projectView.AddNode(topNode, null);
                   topNode.row.Move(prev);
 
@@ -1208,9 +1208,6 @@ private:
    bool Save(const char * fileName)
    {
       File f;
-      /*char output[MAX_LOCATION];
-       ChangeExtension(fileName, "json", output);
-      f = FileOpen(output, write);*/
       f = FileOpen(fileName, write);
       if(f)
       {
@@ -1802,7 +1799,7 @@ private:
                                  message = $"Linker ";
                                  numWarnings++;
                               }
-                              else if(!strstr(line, "error:"))
+                              else if(strstr(line, "error:"))
                               {
                                  message = $"Linker Error: ";
                                  numErrors++;
@@ -2098,7 +2095,7 @@ private:
 
       bool eC_Debug = mode.eC_ToolsDebug;
       bool singleProjectOnlyNode = onlyNodes && onlyNodes.count == 1 && onlyNodes[0].type == project;
-      int numJobs = compiler.numJobs;
+      int numJobs = ide.toolBar.forceSingleJob.checked == true ? 1 : compiler.numJobs;
       char command[MAX_F_STRING*4];
       char * compilerName = CopyString(compiler.name);
       Map<String, NameCollisionInfo> cfgNameCollisions;
@@ -2147,8 +2144,9 @@ private:
                      targetPlatform,
                      bitDepth ? " ARCH=" : "", bitDepth == 32 ? "32" : bitDepth == 64 ? "64" : "",
                      /*(bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" : */"",
-
-                     compilerName, topNode.path, justPrint ? " -n" : "", makeFilePath);
+                     compilerName,
+                     objFileExt ? " O=." : "", objFileExt ? objFileExt : "",
+                     topNode.path, justPrint ? " -n" : "", makeFilePath);
                if(justPrint || raw)
                   ide.outputView.buildBox.Logf("%s\n", command);
                Execute(command);
@@ -2374,7 +2372,7 @@ private:
       sprintf(target, "%s %s", target, args);
       GetWorkingDir(oldDirectory, MAX_LOCATION);
 
-      if(strlen(ide.workspace.debugDir))
+      if(ide.workspace.debugDir && strlen(ide.workspace.debugDir))
       {
          char temp[MAX_LOCATION];
          strcpy(temp, topNode.path);
@@ -2561,10 +2559,10 @@ private:
             f.Puts("ifdef WINDOWS_TARGET\n");
             f.Puts("WINDRES := $(GCC_PREFIX)windres\n");
             f.Puts(" ifdef ARCH\n");
-            f.Puts("  ifeq \"$(ARCH)\" \"x32\"\n");
+            f.Puts("  ifeq ($(ARCH),x32)\n");
             f.Puts("WINDRES_FLAGS := -F pe-i386\n");
             f.Puts("  else\n");
-            f.Puts("   ifeq \"$(ARCH)\" \"x64\"\n");
+            f.Puts("   ifeq ($(ARCH),x64)\n");
             f.Puts("WINDRES_FLAGS := -F pe-x86-64\n");
             f.Puts("   endif\n");
             f.Puts("  endif\n");
@@ -2808,7 +2806,9 @@ private:
 
          // Important: We cannot use this ifdef anymore, EXECUTABLE_TARGET is not yet defined. It's embedded in the crossplatform.mk EXECUTABLE
          //f.Puts("ifdef EXECUTABLE_TARGET\n");
+         f.Puts("ifneq ($(COMPILER),pnacl)\n");
          f.Printf("CONSOLE = %s\n", GetConsole(config) ? "-mconsole" : "-mwindows");
+         f.Puts("endif\n");
          //f.Puts("endif\n");
          f.Puts("\n");
 
@@ -2858,7 +2858,7 @@ private:
                      if(ifCount)
                         f.Puts("else\n");
                      ifCount++;
-                     f.Printf("ifeq \"$(TARGET_TYPE)\" \"%s\"\n", TargetTypeToMakefileVariable(type));
+                     f.Printf("ifeq ($(TARGET_TYPE),%s)\n", TargetTypeToMakefileVariable(type));
 
                      GetMakefileTargetFileName(type, target, config);
                      strcpy(temp, targetDir);
@@ -3383,7 +3383,7 @@ private:
                   f.Puts("\t$(UPX) $(UPXFLAGS) $(TARGET)\n");
                f.Puts("endif\n");
                f.Puts("else\n");
-               //f.Puts("ifneq \"$(TARGET_ARCH)\" \"x86_64\"\n");
+               //f.Puts("ifneq ($(TARGET_ARCH),x86_64)\n");
                   f.Puts("\t$(UPX) $(UPXFLAGS) $(TARGET)\n");
                //f.Puts("endif\n");
                f.Puts("endif\n");