Skip to content

Commit

Permalink
More robust windows detection and more logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Aug 25, 2015
1 parent c195706 commit 9d559b2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os.path
import environment, interpreter, mesonlib
import build
import platform
import mlog, coredata

from coredata import MesonException
Expand Down Expand Up @@ -118,6 +119,8 @@ def generate(self):
env = environment.Environment(self.source_dir, self.build_dir, self.meson_script_file, self.options)
mlog.initialize(env.get_log_dir())
mlog.debug('Build started at', datetime.datetime.now().isoformat())
mlog.debug('Python binary:', sys.executable)
mlog.debug('Python system:', platform.system())
mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version)
mlog.log('Source dir:', mlog.bold(self.source_dir))
Expand Down
4 changes: 2 additions & 2 deletions meson_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys, os, subprocess, time, datetime, pickle, multiprocessing, json
import concurrent.futures as conc
import argparse
import platform
import mesonlib

tests_failed = False

Expand Down Expand Up @@ -62,7 +62,7 @@ def write_json_log(jsonlogfile, test_name, result):
jsonlogfile.write(json.dumps(result) + '\n')

def run_with_mono(fname):
if fname.endswith('.exe') and not platform.system().lower() == 'windows':
if fname.endswith('.exe') and not mesonlib.is_windows():
return True
return False

Expand Down
3 changes: 2 additions & 1 deletion mesonlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def is_linux():
return platform.system().lower() == 'linux'

def is_windows():
return platform.system().lower() == 'windows'
platname = platform.system().lower()
return platname == 'windows' or 'mingw' in platname

def is_debianlike():
try:
Expand Down
8 changes: 4 additions & 4 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

from glob import glob
import os, subprocess, shutil, sys, platform, signal
import os, subprocess, shutil, sys, signal
from io import StringIO
import sys
import environment
Expand Down Expand Up @@ -91,11 +91,11 @@ def setup_commands(backend):
install_commands = [ninja_command, 'install']

def platform_fix_filename(fname):
if platform.system() == 'Darwin':
if mesonlib.is_osx():
if fname.endswith('.so'):
return fname[:-2] + 'dylib'
return fname.replace('.so.', '.dylib.')
elif platform.system() == 'Windows':
elif mesonlib.is_windows():
if fname.endswith('.so'):
(p, f) = os.path.split(fname)
f = f[3:-2] + 'dll'
Expand All @@ -105,7 +105,7 @@ def platform_fix_filename(fname):
return fname

def validate_install(srcdir, installdir):
if platform.system() == 'Windows':
if mesonlib.is_windows():
# Don't really know how Windows installs should work
# so skip.
return ''
Expand Down
7 changes: 4 additions & 3 deletions symbolextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
# This file is basically a reimplementation of
# http://cgit.freedesktop.org/libreoffice/core/commit/?id=3213cd54b76bc80a6f0516aac75a48ff3b2ad67c

import sys, subprocess, platform
import sys, subprocess
import mesonlib
import argparse

parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -84,9 +85,9 @@ def gen_symbols(libfilename, outfilename, cross_host):
# toolset but there are more important things
# to do.
dummy_syms(outfilename)
elif platform.system() == 'Linux':
elif mesonlib.is_linux():
linux_syms(libfilename, outfilename)
elif platform.system() == 'Darwin':
elif mesonlib.is_osx():
osx_syms(libfilename, outfilename)
else:
dummy_syms(outfilename)
Expand Down

0 comments on commit 9d559b2

Please sign in to comment.