aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--mesonbuild/backend/vs2010backend.py2
-rw-r--r--mesonbuild/build.py2
-rw-r--r--mesonbuild/compilers.py2
-rwxr-xr-xrun_tests.py2
-rw-r--r--setup.py6
-rw-r--r--test cases/failing/28 noprog use/meson.build9
7 files changed, 24 insertions, 3 deletions
diff --git a/README.md b/README.md
index bd166eb..82ee3f7 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,10 @@ called 'meson.build'. To generate the build system run this command:
`meson <source directory> <build directory>`
+Depending on how you obtained Meson the command might also be called
+`meson.py` instead of plain `meson`. In the rest of this document we
+are going to use the latter form.
+
You can omit either of the two directories, and Meson will substitute
the current directory and autodetect what you mean. This allows you to
do things like this:
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 84ef8c3..ec10d4c 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -437,7 +437,7 @@ class Vs2010Backend(backends.Backend):
for l, args in target.extra_args.items():
if l in extra_args:
extra_args[l] += args
- general_args = compiler.get_buildtype_args(self.buildtype)
+ general_args = compiler.get_buildtype_args(self.buildtype).copy()
# FIXME all the internal flags of VS (optimization etc) are represented
# by their own XML elements. In theory we should split all flags to those
# that have an XML element and those that don't and serialise them
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index ab9d0d5..3f480e8 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -842,6 +842,8 @@ class CustomTarget:
if isinstance(c, str):
final_cmd.append(c)
elif isinstance(c, dependencies.ExternalProgram):
+ if not c.found():
+ raise InvalidArguments('Tried to use not found external program in a build rule.')
final_cmd += c.get_command()
elif isinstance(c, BuildTarget) or isinstance(c, CustomTarget):
self.dependencies.append(c)
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 9afff2b..3079c5e 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -114,7 +114,7 @@ msvc_winlibs = ['kernel32.lib', 'user32.lib', 'gdi32.lib',
base_options = {
- 'b_pch': coredata.UserBooleanOption('b_lto', 'Use precompiled headers', False),
+ 'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', False),
'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False),
'b_sanitize': coredata.UserComboOption('b_sanitize',
'Code sanitizer to use',
diff --git a/run_tests.py b/run_tests.py
index cbc4e3d..c4f14ec 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -352,7 +352,7 @@ def check_file(fname):
def check_format():
for (root, _, files) in os.walk('.'):
for file in files:
- if file.endswith('.py') or file.endswith('.build'):
+ if file.endswith('.py') or file.endswith('.build') or file == 'meson_options.txt':
fullname = os.path.join(root, file)
check_file(fullname)
diff --git a/setup.py b/setup.py
index 0acce4d..1c96435 100644
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import sys
+
+if sys.version_info[0] < 3:
+ print('Tried to install with Python 2, Meson only supports Python 3.')
+ sys.exit(1)
+
# We need to support Python installations that have nothing but the basic
# Python installation. Use setuptools when possible and fall back to
# plain distutils when setuptools is not available.
diff --git a/test cases/failing/28 noprog use/meson.build b/test cases/failing/28 noprog use/meson.build
new file mode 100644
index 0000000..e4de42f
--- /dev/null
+++ b/test cases/failing/28 noprog use/meson.build
@@ -0,0 +1,9 @@
+project('using not found exe', 'c')
+
+nope = find_program('nonexisting', required : false)
+
+custom_target( 'aa',
+ input: 'meson.build',
+ output: 'foobar',
+ command: [nope, '@INPUT@', '@OUTPUT@']
+)