From: Nabil Ghodbane Date: Tue, 16 Jul 2019 08:08:04 +0000 (+0200) Subject: scs #13189 : quelques ajustements pour MSBuild X-Git-Tag: 5.5.0~46^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=053f74ae71391412911b076c434b00811d449586;p=tools%2Fsat.git scs #13189 : quelques ajustements pour MSBuild --- diff --git a/src/architecture.py b/src/architecture.py index d540482..0662509 100644 --- a/src/architecture.py +++ b/src/architecture.py @@ -44,7 +44,10 @@ def get_user(): import pwd return pwd.getpwuid(os.getuid())[0] - +def get_windows_os_label(): + '''returns the SAT convention used for Windows labeling ''' + return "W" # in order to fulfill the 8196 length constraint! + def get_distribution(codes): '''Gets the code for the distribution @@ -54,7 +57,7 @@ def get_distribution(codes): :rtype: str ''' if is_windows(): - return "W" # in order to fulfill the 8196 length constraint! + return get_windows_os_label() # else get linux distribution description from platform, and encode it with code lin_distrib = platform.dist()[0].lower() diff --git a/src/compilation.py b/src/compilation.py index 48a5620..7eb5071 100644 --- a/src/compilation.py +++ b/src/compilation.py @@ -130,9 +130,8 @@ class Builder: # In case CMAKE_GENERATOR is defined in environment, # use it in spite of automatically detect it if 'cmake_generator' in self.config.APPLICATION: - cmake_option += " -DCMAKE_GENERATOR=%s" \ + cmake_option += " -DCMAKE_GENERATOR=\"%s\"" \ % self.config.APPLICATION.cmake_generator - command = ("cmake %s -DCMAKE_INSTALL_PREFIX=%s %s" % (cmake_option, self.install_dir, self.source_dir)) @@ -263,9 +262,9 @@ CC=\\"hack_libtool\\"%g" libtool''' command = 'msbuild' command = command + " /maxcpucount:" + str(nb_proc) if self.debug_mode: - command = command + " /p:Configuration=Debug" + command = command + " /p:Configuration=Debug /p:Platform=x64 " else: - command = command + " /p:Configuration=Release" + command = command + " /p:Configuration=Release /p:Platform=x64 " command = command + " ALL_BUILD.vcxproj" self.log_command(command) @@ -285,15 +284,14 @@ CC=\\"hack_libtool\\"%g" libtool''' ## # Runs 'make install'. def install(self): - if self.config.VARS.dist_name=="Win": + if self.config.VARS.dist_name==distrib_cfg.DISTRIBUTIONS["Windows"]: command = 'msbuild INSTALL.vcxproj' if self.debug_mode: - command = command + " /p:Configuration=Debug" + command = command + " /p:Configuration=Debug /p:Platform=x64 " else: - command = command + " /p:Configuration=Release" + command = command + " /p:Configuration=Release /p:Platform=x64 " else : command = 'make install' - self.log_command(command) res = subprocess.call(command, @@ -338,7 +336,7 @@ CC=\\"hack_libtool\\"%g" libtool''' # Runs 'make_check'. def check(self, command=""): if src.architecture.is_windows(): - cmd = 'msbuild RUN_TESTS.vcxproj' + cmd = 'msbuild RUN_TESTS.vcxproj /p:Configuration=Release /p:Platform=x64 ' else : if self.product_info.build_source=="autotools" : cmd = 'make check' diff --git a/src/internal_config/distrib.pyconf b/src/internal_config/distrib.pyconf index 43ce36b..f3a01a0 100644 --- a/src/internal_config/distrib.pyconf +++ b/src/internal_config/distrib.pyconf @@ -15,4 +15,5 @@ DISTRIBUTIONS : "redhat": "CO" "ubuntu": "UB" "opensuse":"OS" + "Windows" : "W" }