diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2019-07-14 13:48:07 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2019-07-20 10:06:26 +0200 |
commit | 3a5c5de271d62b5a7f9f9b11f419ab68a5470af9 (patch) | |
tree | dd1fa0f5f48310ddfcf0a9b3944259d80b14919e /build/mixxx.py | |
parent | b1b7ad59d66deac4b4f42dc4120161740942f58e (diff) |
Fix compiler check for MSVC toolchain
Diffstat (limited to 'build/mixxx.py')
-rw-r--r-- | build/mixxx.py | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/build/mixxx.py b/build/mixxx.py index 00f07ebc0f..dac67b7b0b 100644 --- a/build/mixxx.py +++ b/build/mixxx.py @@ -212,23 +212,27 @@ class MixxxBuild(object): self.read_environment_variables() # Now that environment variables have been read, we can detect the compiler. - import shlex - import subprocess - cc_version_cmd = shlex.split(self.env['CC']) + ['--version'] - cc_version = subprocess.check_output(cc_version_cmd).decode(sys.stdout.encoding) - self.compiler_is_gcc = 'gcc' in cc_version.lower() - self.compiler_is_clang = 'clang' in cc_version.lower() - - # Determine the major compiler version (only GCC) - if self.compiler_is_gcc: - self.gcc_major_version = None - gcc_version_cmd = shlex.split(self.env['CC']) + ['-dumpversion'] - gcc_version = subprocess.check_output(gcc_version_cmd).decode(sys.stdout.encoding) - # If match is None we don't know the version. - if not gcc_version is None: - version_split = gcc_version.split('.') - if version_split: - self.gcc_major_version = int(version_split[0]) + if self.toolchain_is_msvs: + self.compiler_is_gcc = False + self.compiler_is_clang = False + else: + import shlex + import subprocess + cc_version_cmd = shlex.split(self.env['CC']) + ['--version'] + cc_version = subprocess.check_output(cc_version_cmd).decode(sys.stdout.encoding) + self.compiler_is_gcc = 'gcc' in cc_version.lower() + self.compiler_is_clang = 'clang' in cc_version.lower() + + # Determine the major compiler version (only GCC) + if self.compiler_is_gcc: + self.gcc_major_version = None + gcc_version_cmd = shlex.split(self.env['CC']) + ['-dumpversion'] + gcc_version = subprocess.check_output(gcc_version_cmd).decode(sys.stdout.encoding) + # If match is None we don't know the version. + if not gcc_version is None: + version_split = gcc_version.split('.') + if version_split: + self.gcc_major_version = int(version_split[0]) self.virtualize_build_dir() |