Commit Graph

2743 Commits

Author SHA1 Message Date
Paulo Antonio Alvarez 1e54a5e73c environment: Use GNU defines to get version of c, c++, objc and fortran
According to
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html,
the macros used to get the version are always defined for those
languages, so use them to get the version.
2016-11-11 08:11:43 -02:00
Paulo Antonio Alvarez 582e1ede80 environment: Static method to get gcc version from compiler defines
The method takes a dictionary with defines names as keys and the defines
values as values. From it, we assemble the gcc version, using 0 as a
default value if the define we want is not defined.
2016-11-11 07:26:51 -02:00
Jussi Pakkanen e02aaad632 Merge pull request #1011 from centricular/runtarget-files-rel-builddir
ninja: Pass absolute path of files to run targets
2016-11-10 14:47:35 -05:00
Jussi Pakkanen fd425d56a5 Merge pull request #991 from mesonbuild/wip/tingping/gresource-depfile
gnome: Use depfile support of recent glib-compile-resources
2016-11-10 14:08:32 -05:00
Jussi Pakkanen dc10945ad7 Merge pull request #995 from centricular/more-appveyor-builds
appveyor.yml: Test more than just MSVC2010 + Ninja on x86
2016-11-09 15:00:46 -05:00
Jussi Pakkanen 5603f90287 Allow tests to mark themselves as skipped during runtime. 2016-11-09 15:00:28 -05:00
Nirbheek Chauhan daa893e011 tests: Disable 113 generatorcustom on VS backends
Can only test this by checking the compiler id, but that's good enough.
Disabling so we can get #995 in which will help keep the VS backend in
a better state w.r.t. other PRs.

I've opened #1004 to track this in the meantime.
2016-11-10 00:49:53 +05:30
Nirbheek Chauhan 9741085068 appveyor.yml: Use x86 python only on x86
It causes the cpython tests to fail when using the x86_64 toolchain.

tachyon_module.c.obj : error LNK2019: unresolved external symbol __imp_PyLong_FromLong referenced in function phaserize
tachyon_module.c.obj : error LNK2019: unresolved external symbol __imp_PyArg_ParseTuple referenced in function phaserize
tachyon_module.c.obj : error LNK2019: unresolved external symbol __imp_PyModule_Create2 referenced in function PyInit_tachyon
c:\\python34/libs\python34.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
ext/tachyon.pyd : fatal error LNK1120: 3 unresolved externals
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 440a922c81 appveyor.yml: Print versions of MSBuild and Ninja
This is useful to know what MSBuild.exe and Ninja we are using and
whether the correct one has been set via PATH by vcvarsall.bat and
hasn't been overwritten by appveyor.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 88f1d400c0 Fix debug PCH builds with MSVC 2012 and later
With MSVC 2013 and newer, using pre-compiled headers with .pdb debugging
fails with the following error message:

fatal error C1041: cannot open program database '[...]\prog.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS

So we use /FS when PCH is enabled. When PCH is enabled and debugging is
disabled, this will have no effect since .pdb files will not be written.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 69756fdabb Fix 103 manygen with MSVC on Windows
The code generated manually with manygen.py must use the same CRT
compiler arguments as the final executable itself or we get an error
during linking:

MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
depuser.exe : fatal error LNK1120: 1 unresolved externals
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 408686a31d Fix 62 exe static shared on MSVC
The static function also needs to be DLL exported to be found.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan f09508dde7 51 pkgconfig-gen: Disable validation on Windows
The pkg-config version shipped with MinGW is too old, and the test is
sufficiently covered on Linux, so just skip it on Windows. We anyway do
not run the other pkg-config tests on Windows.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 00dc929b62 vs: Properly split per-compiler args into per-file options
Previously we were just dumping all defines and include directories into
the target-wide list of defines and include directories. Now we have
separate per-target and per-file (actually per-language) arguments,
defines, and include directories.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 52eab4b006 vs backend: coredata.meson_script_file was renamed 2016-11-10 00:40:16 +05:30
Nirbheek Chauhan a90af371f6 project tests: Fix appveyor overwriting the platform env variable
There is no way to do this in the .appveyor.yml file since it seems that
the appveyor environment is forcibly written after each cmd command that
is run.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan da782c62df project tests: Skip lang-specific tests based on backend
XCode and Visual Studio are likely never going to support these
languages, so don't fail if the compiler happens to be in the PATH.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 304061644b appveyor.yml: Test more than just MSVC2010 + Ninja on x86
Now we test:
 MSVC 2010 + Ninja (x86)
 MSVC 2015 + Ninja (x86)
 MSVC 2015 + Ninja (x86_64)
 MSVC 2010 + MSBuild (x86)
 MSVC 2015 + MSBuild (x86)
 MSVC 2015 + MSBuild (x86_64)

MSVC 2010 Express only shipped with an x86 toolchain, so we can only
test x86 for that.
2016-11-10 00:38:24 +05:30
Patrick Griffis c7226462a2 gnome: Improve dependency handling of compile_resources()
- Use depfile support on recent glib-compile-resources
- Don't pass dep files to header ever
- Pass depends for generated deps
- Avoid duplicate --sourcedir args
- Include correct subdir of generated deps
2016-11-09 17:40:42 +01:00
Patrick Griffis 573b3afb52 backends: Output depfiles in same directory as target 2016-11-09 17:39:30 +01:00
Nirbheek Chauhan 5fdac48250 custom_target: Substitute @OUTPUT@ and @INPUT properly
They weren't being substituted if they were a part of a command
argument, ala --output=@OUTPUT@, etc.

Closes https://github.com/mesonbuild/meson/issues/824
2016-11-09 11:30:09 -05:00
Jussi Pakkanen 4d8e3be08f Create target directory if it does not exist. Closes #935. 2016-11-09 11:26:04 -05:00
Jussi Pakkanen cf7b50364f Merge pull request #1006 from centricular/cpp-has-header-symbol
A bunch of fixes for compiler checks with C++
2016-11-09 10:27:28 -05:00
Jussi Pakkanen f7431fd5db Can specify scan-build executable with an environment variable. Closes #1015. 2016-11-09 10:26:27 -05:00
Nirbheek Chauhan 3a4d56c2d3 rpm: Fix trivial typo in BuildRequires
coredata.deps is keyed with a tuple; we want the first element of that
(the pkg-config dependency name) here.

See: https://fedoraproject.org/wiki/Packaging:PkgConfigBuildRequires

Closes https://github.com/mesonbuild/meson/issues/955
2016-11-08 17:45:31 -05:00
Jussi Pakkanen 7408862db8 Merge pull request #1005 from centricular/javac-no-java
javac: Don't fail if there's no JVM
2016-11-08 17:44:18 -05:00
Nirbheek Chauhan a2262103fb Implement mlog.warning and use it everywhere for warnings
Prepends the string with 'WARNING:' in ANSI yellow.

Closes https://github.com/mesonbuild/meson/issues/961
2016-11-08 17:43:24 -05:00
Nirbheek Chauhan b1898fd139 ninja: Pass absolute path of files to run targets
We already pass everything else (custom targets, build targets, etc) as
absolute paths, and this is the only sane way to handle this till we
rework the codebase to use File objects everywhere (after reworking the
File object itself).

Fixes https://github.com/mesonbuild/meson/issues/957
2016-11-09 03:04:37 +05:30
Nirbheek Chauhan 66ec8c4258 tests: Check that run_target can find a files() argument
Tests https://github.com/mesonbuild/meson/issues/957
2016-11-09 03:03:33 +05:30
Nirbheek Chauhan 377fe51003 project tests: Require both javac and java for Java tests 2016-11-09 02:38:10 +05:30
Nirbheek Chauhan e90f21ae59 javac: Fail gracefully if there's no JVM
Without this, we error out with an exception if `javac` is found but
`java` isn't:

[...]
File "mesonbuild/interpreter.py", line 1759, in detect_compilers
  comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
File "mesonbuild/compilers.py", line 1279, in sanity_check
  pe = subprocess.Popen(cmdlist, cwd=work_dir)
File "/usr/lib64/python3.5/subprocess.py", line 947, in __init__
  restore_signals, start_new_session)
File "/usr/lib64/python3.5/subprocess.py", line 1551, in _execute_child
  raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'java'
2016-11-09 02:37:56 +05:30
Jussi Pakkanen 841380acfe Search for headers in build dir before source dir. Closes #984. 2016-11-08 15:00:42 -05:00
Nirbheek Chauhan 30392a3a8a Inherit VisualStudioCPPCompiler from CPPCompiler
Without this our custom C++ has_header_symbol implementation is not used
with the Visual Studio C++ compiler.
2016-11-08 23:52:01 +05:30
Nirbheek Chauhan f144e50f5c has_function: Cast to void* instead of int
Clang++ doesn't allow that, but void* will always be allowed because
lots of projects depend on that.

error: cast from pointer to smaller type 'int' loses information
2016-11-08 16:22:40 +05:30
Nirbheek Chauhan 1e1abc675e travis.yml: Export CC and CXX inside the docker instance
docker does not inherit the parent environment and loses the CC/CXX
settings for testing against clang and gcc.
2016-11-08 16:19:28 +05:30
Nirbheek Chauhan d41b903f07 travis.yml: Don't test for GCC on OS X
GCC on OS X is just a wrapper around Clang, so the test results will
always be identical.
2016-11-08 16:08:50 +05:30
Nirbheek Chauhan ae5a362950 tests/common: Run compiler checks for both C & C++
Without this we're just hoping that the C++ compiler behaves the same
way as the C compiler, which is not always true as demonstrated by
https://github.com/mesonbuild/meson/issues/958
2016-11-08 16:05:32 +05:30
Nirbheek Chauhan 7400284e32 has_function: Fix trivial typo
This was breaking has_function on C++
2016-11-08 16:05:32 +05:30
Nirbheek Chauhan 4d84241ccf has_header_symbol: Also detect C++ classes and templates
With the `using` keyword we can try to use the specified class or
template which will tell us if it exists.
2016-11-08 16:05:32 +05:30
Nirbheek Chauhan f6dfd36239 has_header_symbol: Make it work with C++ compilers
Need to pass -fpermissive to force C++ compilers to only warn about our
non-conformant code that tests for a symbol being defined.

Also do a simple #ifdef check first in has_header_symbol to allow
arbitrary macros to be detected which would not have been detected
earlier. This follows what AC_CHECK_DECL does.

Closes #958
2016-11-08 15:42:15 +05:30
alvarez86 87f07cdf3d Minor adjusts (#1001)
* contributing: Use should instead of thould

* interpreter: Use exist_ok parameter in subdir function

We explicitly depend on python 3.4 or newer, which means the exist_ok
parameter is available. Use it instead of a try with a pass on except.

* authors: Add my name at the end of authors file
2016-11-07 11:26:46 -08:00
Jussi Pakkanen 8d182e00c9 Use a cross linker when cross compiling. 2016-11-06 10:14:43 -08:00
Jussi Pakkanen 335d263315 Merge pull request #942 from mesonbuild/tingping/private-methods
Don't expose private module methods
2016-11-06 09:13:39 -08:00
Jussi Pakkanen f8bf37979b Merge pull request #993 from centricular/cached-dep-required-attr
dependency: Check that cached_dep has the 'required' attribute
2016-11-06 09:11:42 -08:00
Jussi Pakkanen ae8a0a1438 Merge pull request #994 from centricular/more-travis-builds
travis.yml: Run tests against both gcc and clang
2016-11-06 09:10:49 -08:00
Jussi Pakkanen 1cf787f281 Added reconfigure target that always reruns Meson. 2016-11-06 09:10:04 -08:00
Jussi Pakkanen 90f5af8a90 Merge pull request #950 from centricular/fix-dependency-subproject-exceptions
Don't ignore invalid code related to subproject calls
2016-11-06 09:09:36 -08:00
Patrick Griffis fb7d9c7aef gnome: Mark helper functions as private 2016-11-06 00:02:53 -04:00
Patrick Griffis 1811f83e2a Don't expose module functions prefixed with _
This is the common Python convention for private methods
so lets not expose these to build files as they are
implementation details and their behavior is undefined.
2016-11-06 00:01:36 -04:00
Tim-Philipp Müller d37bbef411 ninjabackend: fix error message 2016-11-05 03:10:36 -07:00