]> SALOME platform Git repositories - tools/sat.git/blobdiff - src/compilation.py
Salome HOME
changement nom distrib pour DB09 (normalisation)
[tools/sat.git] / src / compilation.py
index 8fb8954ee5664775ae8598ae52daefd7d45063d0..e958f9cddcddd1318336962fb2e11e1b07182baf 100644 (file)
@@ -51,6 +51,9 @@ class Builder:
         self.debug_mode = False
         if "debug" in self.product_info and self.product_info.debug == "yes":
             self.debug_mode = True
+        self.verbose_mode = False
+        if "verbose" in self.product_info and self.product_info.verbose == "yes":
+            self.verbose_mode = True
 
     ##
     # Shortcut method to log in log file.
@@ -118,7 +121,11 @@ class Builder:
             cmake_option += " -DCMAKE_BUILD_TYPE=Debug"
         else :
             cmake_option += " -DCMAKE_BUILD_TYPE=Release"
-        
+
+        # add verbose option if specified in application for this product.
+        if self.verbose_mode:
+            cmake_option += " -DCMAKE_VERBOSE_MAKEFILE=ON"
+
         # In case CMAKE_GENERATOR is defined in environment, 
         # use it in spite of automatically detect it
         if 'cmake_generator' in self.config.APPLICATION:
@@ -129,6 +136,8 @@ class Builder:
                             (cmake_option, self.install_dir, self.source_dir))
 
         self.log_command(command)
+        # for key in sorted(self.build_environ.environ.environ.keys()):
+            # print key, "  ", self.build_environ.environ.environ[key]
         res = subprocess.call(command,
                               shell=True,
                               cwd=str(self.build_dir),
@@ -244,19 +253,14 @@ CC=\\"hack_libtool\\"%g" libtool'''
     
     ##
     # Runs msbuild to build the module.
-    def wmake(self, opt_nb_proc = None):
-        nbproc = self.get_nb_proc(opt_nb_proc)
+    def wmake(self,nb_proc, opt_nb_proc = None):
 
-        hh = 'MSBUILD /m:%s' % str(nbproc)
+        hh = 'MSBUILD /m:%s' % str(nb_proc)
         if self.debug_mode:
             hh += " " + src.printcolors.printcWarning("DEBUG")
-        self.log_step(hh)
-
         # make
         command = 'msbuild'
-        if self.options.makeflags:
-            command = command + " " + self.options.makeflags
-        command = command + " /maxcpucount:" + str(nbproc)
+        command = command + " /maxcpucount:" + str(nb_proc)
         if self.debug_mode:
             command = command + " /p:Configuration=Debug"
         else:
@@ -442,11 +446,12 @@ CC=\\"hack_libtool\\"%g" libtool'''
 
         self.log_command("  " + _("Run build script %s\n") % script)
         self.complete_environment(make_options)
+        
         res = subprocess.call(script, 
                               shell=True,
                               stdout=self.logger.logTxtFile,
                               stderr=subprocess.STDOUT,
-                              cwd=str(self.build_dir), 
+                              cwd=str(self.build_dir),
                               env=self.build_environ.environ.environ)
 
         self.put_txt_log_in_appli_log_dir("script")
@@ -492,4 +497,4 @@ CC=\\"hack_libtool\\"%g" libtool'''
         shutil.move(self.logger.txtFilePath, file_path)
         self.logger.logTxtFile = open(str(self.logger.txtFilePath), 'w')
         self.logger.logTxtFile.write(open(file_path, "r").read())
-        
\ No newline at end of file
+