aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilers.py6
-rw-r--r--interpreter.py2
-rwxr-xr-xmeson.py3
-rwxr-xr-xmeson_test.py4
-rw-r--r--mesonlib.py3
-rwxr-xr-xrun_tests.py8
-rwxr-xr-xsymbolextractor.py7
7 files changed, 21 insertions, 12 deletions
diff --git a/compilers.py b/compilers.py
index 2b24aea..134edda 100644
--- a/compilers.py
+++ b/compilers.py
@@ -227,7 +227,11 @@ class CCompiler():
mlog.debug('Is cross compiler: %s.' % str(self.is_cross))
source_name = os.path.join(work_dir, 'sanitycheckc.c')
- binary_name = os.path.join(work_dir, 'sanitycheckc')
+ if self.is_cross:
+ binname = 'sanitycheckc_cross'
+ else:
+ binname = 'sanitycheckc'
+ binary_name = os.path.join(work_dir, binname)
ofile = open(source_name, 'w')
ofile.write('int main(int argc, char **argv) { int class=0; return class; }\n')
ofile.close()
diff --git a/interpreter.py b/interpreter.py
index 559c561..5e8effc 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -699,6 +699,7 @@ class ModuleHolder(InterpreterObject):
state.subdir = self.interpreter.subdir
state.environment = self.interpreter.environment
state.project_name = self.interpreter.build.project_name
+ state.project_version = self.interpreter.build.dep_manifest[self.interpreter.active_projectname]
state.compilers = self.interpreter.build.compilers
state.targets = self.interpreter.build.targets
state.headers = self.interpreter.build.get_headers()
@@ -1167,7 +1168,6 @@ class Interpreter():
raise InterpreterException('Recursive include of subprojects: %s.' % incpath)
if dirname in self.subprojects:
return self.subprojects[dirname]
- subdir = os.path.join(self.subproject_dir, dirname)
r = wrap.Resolver(os.path.join(self.build.environment.get_source_dir(), self.subproject_dir))
resolved = r.resolve(dirname)
if resolved is None:
diff --git a/meson.py b/meson.py
index 01a46fc..db45609 100755
--- a/meson.py
+++ b/meson.py
@@ -19,6 +19,7 @@ import datetime
import os.path
import environment, interpreter, mesonlib
import build
+import platform
import mlog, coredata
from coredata import MesonException
@@ -118,6 +119,8 @@ itself as required.'''
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))
diff --git a/meson_test.py b/meson_test.py
index 4273e9b..9353b18 100755
--- a/meson_test.py
+++ b/meson_test.py
@@ -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
@@ -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
diff --git a/mesonlib.py b/mesonlib.py
index c7cf208..76fb792 100644
--- a/mesonlib.py
+++ b/mesonlib.py
@@ -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:
diff --git a/run_tests.py b/run_tests.py
index 673c55b..7d5f92f 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -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
@@ -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'
@@ -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 ''
diff --git a/symbolextractor.py b/symbolextractor.py
index b184cff..f2c709d 100755
--- a/symbolextractor.py
+++ b/symbolextractor.py
@@ -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()
@@ -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)