Commit Graph

3467 Commits

Author SHA1 Message Date
Jon Turney 90a483fa74 Skip some linuxlike tests which don't work on Cygwin 2017-04-06 22:48:02 +01:00
Jon Turney 45a3bd8661 Skip objc/nsstring test on Cygwin
GNUstep isn't packaged for Cygwin
2017-04-06 22:48:02 +01:00
Jon Turney 4ef4a659f2 Fix test cases/common/37 on Cygwin
Including newlib's <stdlib.h> brings in a '#define __has_include 0', so
using -U__has_include on the command line isn't going to remove it (so the
fallback doesn't happen and the test fails)

Instead use a '#undef __has_include' at the end of the prefix to excerise
this.

(newlib's <stdlib.h> is derived from FreeBSD, so the same problem will
probably be seen there)
2017-04-06 22:48:02 +01:00
Jon Turney 205b375723 Cygwin uses the msabi calling convention on x86_64
Fix test cases/common/126 and 135 on Cygwin/x86_64

Cygwin also uses the msabi calling convention on x86_64, not the sysvabi
calling convention.
2017-04-06 22:48:02 +01:00
Jon Turney 3194ab9420 Add myself to authors.txt 2017-04-06 22:48:02 +01:00
Jon Turney fd47ef3a27 Use '.exe' extension for executables for Cygwin
Use '.exe' extension for executables for Cygwin when building and installing
2017-04-06 22:47:15 +01:00
Jon Turney 5af98a5ee8 Use correct shared library naming for Cygwin
Use correct shared library naming for Cygwin when building and installing
2017-04-06 22:47:15 +01:00
Jon Turney 600f16f9f8 Use extra_paths on Cygwin
Cygwin executables are still loaded by the Windows PE loader, so PATH needs
to include any extra directories where required DLLs can be found.

Cygwin uses a unix style ':'-separated PATH.  os.pathsep is used correctly
on extra_paths in meson_exe.py, but not in mesontest.py
2017-04-06 22:47:15 +01:00
Jon Turney cbc5064a67 Don't use -fPIC on Cygwin, either
Identify Cygwin-targetted gcc as sui generis (don't use -fPIC, but don't
link with standard Windows libraries, either)

Update tests appropriately
2017-04-06 22:47:15 +01:00
Aaron Plattner c80ca384b2 Don't crash if a meson.build file is empty (#1570)
* Don't crash if a meson.build file is empty

Commit 9adef3a8e8 caused an empty meson.build file to generate a traceback:

 Traceback (most recent call last):
   File "/usr/lib/python3.6/site-packages/mesonbuild/mparser.py", line 415, in getsym
     self.current = next(self.stream)
 StopIteration

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/usr/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 298, in run
     app.generate()
   File "/usr/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 180, in generate
     intr.run()
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreter.py", line 2529, in run
     super().run()
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 125, in run
     self.evaluate_codeblock(self.ast, start=1)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 146, in evaluate_codeblock
     raise e
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 140, in evaluate_codeblock
     self.evaluate_statement(cur)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 151, in evaluate_statement
     return self.function_call(cur)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 372, in function_call
     return self.funcs[func_name](node, self.flatten(posargs), kwargs)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 47, in wrapped
     return f(self, node, args, kwargs)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreter.py", line 2237, in func_subdir
     self.evaluate_codeblock(codeblock)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 146, in evaluate_codeblock
     raise e
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 140, in evaluate_codeblock
     self.evaluate_statement(cur)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 151, in evaluate_statement
     return self.function_call(cur)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 372, in function_call
     return self.funcs[func_name](node, self.flatten(posargs), kwargs)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreterbase.py", line 47, in wrapped
     return f(self, node, args, kwargs)
   File "/usr/lib/python3.6/site-packages/mesonbuild/interpreter.py", line 2233, in func_subdir
     codeblock = mparser.Parser(code, self.subdir).parse()
   File "/usr/lib/python3.6/site-packages/mesonbuild/mparser.py", line 410, in __init__
     self.getsym()
   File "/usr/lib/python3.6/site-packages/mesonbuild/mparser.py", line 417, in getsym
     self.current = Token('eof', '', self.current.line_start, self.current.lineno, self.current.colno + self.current.bytespan[1] - self.current.bytespan[0], (0, 0), None)
 AttributeError: 'Parser' object has no attribute 'current'
2017-04-07 00:10:48 +03:00
Jussi Pakkanen 578c3b6b6a Renamed tests with the same number. 2017-04-05 00:40:52 +03:00
Jussi Pakkanen b42adc8a54 Merge pull request #1511 from centricular/get-define
New compiler function: cc.get_define()
2017-04-05 00:02:41 +03:00
Nirbheek Chauhan 41769d0c10 Prohibit ':' in project names
This would make it harder to parse an option to mesonconf such
as -Dfoo:bar:baz:fun=value since it could mean either of these:

* For subproject 'foo:bar:baz', set the option 'fun' to 'value'
* For subproject 'foo:bar', an invalid option 'baz:fun' was set

To differentiate between these two we'd need to create the list of
subprojects first and then parse their options later, which
complicates the parsing quite a bit.
2017-04-05 01:30:34 +05:30
Jussi Pakkanen 655757bc00 Merged Valgrind dependency branch. 2017-04-04 22:26:55 +03:00
Nirbheek Chauhan 8ee9365717 Allow option values to contain ':'
Instead, check that option keys don't contain ':'. Also change the
failing option test to look for this.

Closes https://github.com/mesonbuild/meson/issues/1454
2017-04-04 23:41:23 +05:30
Nirbheek Chauhan 6042e21e25 Use CPPFLAGS for pre-processor compiler checks
Also don't add CFLAGS twice for links() checks

Includes a test for this.
2017-04-04 23:38:36 +05:30
Jussi Pakkanen 14579ed9c5 Merge pull request #1557 from pitti/fix/configure_data-files-input
Fix configure_data files input
2017-04-04 20:57:17 +03:00
Nirbheek Chauhan 09fee02dd9 Use shlex.split() to split CFLAGS/LDFLAGS/etc
This allows people to use spaces in the environment variables as long
as they use the correct quoting.
2017-04-04 22:30:13 +05:30
Nirbheek Chauhan de47541e6c New compiler function: cc.get_define()
Runs the pre-processor and fetches the value of the define.

Can find any arbitrary value and returns it as a string.
2017-04-04 22:30:13 +05:30
Nirbheek Chauhan d0d7cbd88b compilers: Rename 'get_define' to 'get_builtin_define'
We will use `get_define` to implement a function that fetches the
values of defines from headers.
2017-04-04 22:30:13 +05:30
Jussi Pakkanen 99649e6690 Merge pull request #1520 from mesonbuild/tingping/python3-module
Add get_path() and get_version() methods to the python3 module
2017-04-03 23:38:07 +03:00
Jussi Pakkanen 8b73d80792 Merge pull request #1457 from mesonbuild/overrides
Add MVP implementation of overriding options.
2017-04-03 23:31:32 +03:00
Nirbheek Chauhan 3070461ecc tests/common/141: Fix build on mingw64 2017-04-03 23:28:01 +03:00
Philipp Ittershagen 734b1973e5 update authors.txt 2017-04-03 21:11:30 +02:00
Philipp Ittershagen adebed8ec8 Enable File() objects as an input parameter to configure_file
The configure_file command raised an exception when an input was specified as a
File, because os.path.join does not take File objects directly.  This patch
converts a File object to a string and adjusts the subsequent os.path.join
calls.
2017-04-03 21:09:31 +02:00
Philipp Ittershagen 64e8f2c7bf Refactor duplicate code in File
Increase readability using the File method self.relative_name() to factor out
some of the os.path.join(...) commands.
2017-04-03 21:08:59 +02:00
Jussi Pakkanen c7f66c3a9e Merge pull request #1505 from centricular/dont-use-c++-for-assembly
Try harder to use the C compiler for compiling asm
2017-04-02 00:15:22 +03:00
Jussi Pakkanen 1b81b32afb Add test for werror which is a boolean type. 2017-04-02 00:07:23 +03:00
Jussi Pakkanen 553ac89e02 Review fixes. 2017-04-02 00:07:23 +03:00
Jussi Pakkanen 319398f074 Proxy object for overriding options transparently. 2017-04-02 00:07:23 +03:00
Jussi Pakkanen cf97c7af81 Use get_option_for_target for builtins where sensible. 2017-04-02 00:07:23 +03:00
Jussi Pakkanen 294abe244f Use relative object file name for unity files everywhere. 2017-04-02 00:04:45 +03:00
Jussi Pakkanen 7b66ff8921 Create unity files with the VS backend. 2017-04-02 00:04:45 +03:00
Jussi Pakkanen e5a6283c4c Add MVP implementation of overriding options. 2017-04-02 00:04:45 +03:00
Patrick Griffis 86644bbdfc python3: Add tests for sysconfig_path() and language_version() 2017-03-30 09:16:26 -04:00
Patrick Griffis a9c30ce8b5 python3: Add sysconfig_path() method
This returns the value of sysconfig paths, useful for
installing modules for example.
2017-03-30 09:13:01 -04:00
Patrick Griffis b6e06dd80b python3: Add language_version() method 2017-03-30 09:13:01 -04:00
melak47 d2548e6e83 strip trailing backslash from WindowsSDKVersion (#1538) 2017-03-30 14:29:34 +03:00
Dylan Baker 7aa28456df Add dependency type for Valgrind
Valgrind is a bit of a strange beast, in general use one isn't supposed
to link against valgrinds libs, they're non-PIC static libs, instead,
including the headers does magic to make valgrind work.

This patch implements a simple ValgrindDependency class subclassed from
PkgConfigDependency, that overwrites (effectively) only the
get_link_args method to always return an empty list. This solution may
seem strange, but I think that it follows the principle of least
surprise, and simplifies the most common use case for valgrind.

Essentially without this every valgrind consumer would be forced to
implement the following code to have a usable valgrind dependency
object:

_dep = dependency('valgrind', required : false)
if _dep.found()
  valgrind_dep = declare_dependency(
    compile_args : _dep.get_pkgconfig_variable('Cflags')
  )
else
  valgrind_dep = []
endif

While the above is workable, it's surprising behavior and the above code
snippet becomes boilerplate that everyone needs to copy into their meson
files.

Fixes #826
2017-03-29 13:56:29 -07:00
kalmiya fa10703124 fix "Meson encountered an error in file meson.build, line 19, column … (#1536)
fix "Meson encountered an error in file meson.build, line 19, column 8: Unknown method "set_install_script" in object."
2017-03-29 23:37:51 +03:00
Jussi Pakkanen 571451b521 Merge pull request #1346 from msink/test-mingw
appveyor: run tests against MSYS2-MinGW
2017-03-29 22:52:14 +03:00
Nirbheek Chauhan 8df671b6f3 run_tests: Don't run unit tests when the VS backend is selected 2017-03-30 00:49:29 +05:30
Nirbheek Chauhan 9261243834 tests/common/141: Also test C + asm targets
Ensure that they are all built with and linked with the C compiler
2017-03-30 00:47:00 +05:30
Tim-Philipp Müller 8cc89e468d configure_file: make input arg optional if command is used
Fixes #1476
2017-03-29 21:24:06 +03:00
Patrick Griffis 9929e0efac rust: Support executable name differing from source name 2017-03-29 21:09:51 +03:00
Peter Harris 65377ff16a Fix warning making static libs on msvc/ninja
The MSVC static library tool, lib.exe, does not understand the same set
of arguments as the linker. Avoid a warning by not adding /DEBUG or /PDB
to the command line when invoking lib.exe
2017-03-28 23:01:48 +03:00
Nirbheek Chauhan 87f35d7118 tests/windows/5: Skip if build_to_src has spaces
In this case, the arguments to MinGW windres will contain spaces and
the test will definitely fail, so just skip it.

This effectively means that manually running the test will be fine, but
running it via run_project_tests.py will always fail (skip).
2017-03-28 15:51:35 +05:30
Nirbheek Chauhan dc5b0a62f6 appveyor: Move msys2-mingw matrix a little higher
Allows us to see failures in it sooner because it will be run earlier
2017-03-28 14:58:48 +05:30
Nirbheek Chauhan 976c9abcd0 modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@
First step in fixing https://github.com/mesonbuild/meson/issues/1419

Also works around an issue in the MinGW windres.exe that causes it to
fail if any of the arguments passed to it contain a space. There seems
to be no way to quote or escape the spaces in the path to make windres
parse the path correctly, so we just warn about it instead.

https://sourceware.org/bugzilla/show_bug.cgi?id=4933
https://github.com/mesonbuild/meson/pull/1346
2017-03-28 14:49:32 +05:30
Nirbheek Chauhan 03d0feec7c tests/windows/5: Add more subdirs to the test
This improves test coverage by testing that resources, includes, and
build targets being in separate directories works properly.
2017-03-28 14:47:55 +05:30