Commit Graph

343 Commits

Author SHA1 Message Date
Michael Hirsch, Ph.D 72486afd08 Add PGI C and C++ compilers (#4803) 2019-01-21 20:09:36 +02:00
Michael Hirsch, Ph.D b40c1af900
Flang Fortran compiler added. 2019-01-16 17:06:43 -05:00
Daniel Mensinger af38722f89 mintro: Introspection interpreter refactoring (#4733)
* Fixed spelling

* Merged the Buildoptions and Projectinfo interpreter

* Moved detect_compilers to Environment

* Added removed test case

* Split detect_compilers and moved even more code into Environment

* Moved set_default_options to coredata

* Small code simplification in mintro.run

* Move cmd_line_options back to `environment`

We don't actually wish to persist something this unstructured, so we
shouldn't make it a field on `coredata`. It would also be data
denormalization since the information we already store in coredata
depends on the CLI args.
2019-01-16 23:42:54 +02:00
Michael Hirsch, Ph.D fff88b354a restore PGI compile functioning 2019-01-15 20:27:31 +02:00
Antoine Jacoutot e02b79dc1e OpenBSD: register machine cpu "macppc" as cpu_family "ppc"
On OpenBSD, the main PowerPC machine is known as macppc, while the processor
family is powerpc:
$ uname -{m,p}
macppc powerpc
$ echo 'import platform; print (platform.machine())' | python3
macppc
$ echo 'import platform; print (platform.processor())' | python3
powerpc

This allows for e.g. GLib configure to properly detect that cpu:
Build machine cpu family: ppc
Build machine cpu: macppc
While it failed before with: WARNING: Unknown CPU family 'macppc' <snip>
2019-01-13 14:23:16 +02:00
John Ericson 8165fa6ad0 Fix finding the static linker for native compiler in cross build
Native ar and cross ar are not the same!
2019-01-10 23:04:41 +02:00
Jussi Pakkanen 198de0de5d Report parisc64 as parisc. Closes #4714. 2019-01-09 00:13:57 +02:00
Daniel Mensinger 9c214f4a70
Fixed buildoptions form source 2019-01-06 12:19:34 +01:00
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 2019-01-06 12:19:29 +01:00
Jon Turney a223b20bb6
Fix linking when cross-compiling and a windows resource is first object
It appears that LIB/LINK default to the host architecture if they can't
guess it from the first object.  With the MSVC toolchain, resource files
are (usually) compiled to an arch-neutral .res format.  Always
explicitly provide a '/MACHINE:' argument to avoid it guessing
incorrectly when cross-compiling.
2019-01-05 20:22:13 +00:00
John Ericson e147054d6f Get rid of `ConfigData` 2019-01-02 16:22:47 -05:00
John Ericson edb3585b65 Simplify config file checking code, inlining `_ok_type` 2019-01-02 16:22:47 -05:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
John Ericson dbf080afe9 Get rid of `need_cross_compiler`
Building a cross compiler (`build == host != target`) is not cross
compiling. As such, it doesn't make sense to handle it under
`is_cross_build`.

(N.B. Building a standard library for a cross compiler would require
cross compiling, but Meson has support to do such a thing as part of a
compiler build currently.)
2019-01-02 16:11:02 -05:00
Daniel Mensinger c033af914a
Disable mlog and don't require build directory for environment 2018-12-29 23:55:45 +01:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen 3d7c32a34e
Merge pull request #4451 from jon-turney/simplify-x86-msvc-test
Simplify x86 msvc test
2018-12-29 18:43:13 +02:00
Jussi Pakkanen 131459bd05 Add Renesas RL78 CPU family. Closes #4606. 2018-12-11 20:56:35 +02:00
Jon Turney 4da68b7ba9
Try to handle ARM64 in detect_windows_arch()
Putative changes to handle Windows on ARM64, which can also run x86 code
under WOW64
2018-12-06 13:27:12 +00:00
Jon Turney f3b5c3c27d
Simplify test for x86 targeted MSVC cross-compiler
We can't just do compiler.has_builtin_define('_M_IX86'), because the
VisualStudioCCompiler class doesn't implement has_builtin_define(), and
getting the compiler to disgorge it's builtin defines isn't easy...

But we can now use the target we stored when we identifed the compiler.

Also update comment appropriately
2018-12-06 13:26:51 +00:00
Jon Turney a872b925ea
Store the target architecture for CL-like compilers
Store the MSVC compiler target architecture ('x86', 'x64' or 'ARM' (this
is ARM64, I believe)), rather than just if it's x64 or not.

The regex used for target architecture should be ok, based on this list
of [1] version outputs, but we assume x86 if no match, for safety's
sake.

[1] https://stackoverflow.com/a/1233332/1951600

Also detect arch even if cl outputs version to stdout.

Ditto for clang-cl

Future work: is_64 is now only used in get_instruction_set_args()
2018-12-06 13:25:16 +00:00
Nirbheek Chauhan 0b3a607fd8 Correctly detect 32-bit arm userland on 64-bit arm
This is the same case as 32-bit x86 on x86_64.

Closes https://github.com/mesonbuild/meson/issues/4586
2018-12-05 19:39:01 +02:00
Nirbheek Chauhan 579b5bba12 Reorganize cpu detection code to be more consistent
Use a single point of exit for the detect_cpu* functions, and factor
out the compiler define code into a helper function.
2018-12-05 19:39:01 +02:00
Nirbheek Chauhan b75ff762f8 Fix detection with VS 2017, and fix a bug in detection on VS 2008
Starting with VS 2017, `Platform` is not always set (f.ex., if you use
VsDevCmd.bat directly instead of vcvars*.bat), but `VSCMD_ARG_HOST_ARCH`
is always set, so try that first.
2018-12-05 19:39:01 +02:00
John Preston c17a80f47b Use correct environment for REGEN in VS backend.
Try to guess which VS Command Prompt was used for the Meson call.
If one is chosen invoke it before calling Meson in REGEN command.
2018-12-04 20:19:19 +02:00
John Ericson 2ba97d506d Use more `environment.default_*` for consistency
After we make this work consistently, we can try to abstract the new pattern.
2018-12-03 22:34:53 +02:00
Dylan Baker e338e9ad2f environment: detect compilers from native files 2018-11-14 15:57:37 -08:00
Dylan Baker 3af4407a16 Get basic native config file loading working 2018-11-14 15:57:37 -08:00
Dylan Baker 95403cb615 replace ExternalProgram.from_cross_info with from_bin_list
This more generic method will also be used to check a config file for
binary information.
2018-11-14 15:57:37 -08:00
Michael Forney 50b2ef7354 Consider 'samu' when looking for ninja command
samu prints a different message when the build is a no-op, so make
assertBuildIsNoop consider that as well.

Also, if compile_commands.json cannot be found, just skip the test. This
seems reasonable since meson just produces a warning if `ninja -t compdb`
fails.

Finally, only capture stdout in run_meson_command_tests.py, since the
backend may print messages the tests don't recognize to stderr.

Fixes #3405.
2018-11-11 00:21:47 +02:00
Dylan Baker d405b74caf java: javac 9+ print their version to stdout not stderr
Fixes: #2569
2018-11-07 14:26:03 -08:00
Phillip Cao 68c83cb213 Add support for Renesas CC-RX toolchain 2018-11-08 00:02:22 +13:00
Xavier Claessens 43101489cd Recover when coredata cannot be loaded
Write command line options into a separate file to be able to
reconfigure from scatch in the case coredata cannot be loaded. The most
common case is when we are reconfiguring with a newer meson version.

This means that we should try as much as possible to maintain backward
compatibility for the cmd_line.txt file format.

The main difference with a normal reconfigure is it will use new
default options values and will read again environment variables like
CFLAGS, etc.
2018-11-06 16:37:13 -05:00
John Ericson d178fd0ab3 Begin to factor out logic for getting binaries
This gets the ball rolling, and doesn't depend on any of my other PRs in
flight.

Progress towards #4332
2018-11-06 21:06:50 +02:00
Jon Turney 2993fc4e8a
Use llvm-lib as an alternative to lib
Detect llvm-lib as an alternative Windows static linker to lib
2018-11-04 15:42:06 +00:00
Jon Turney 64edfd5069
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX

Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.

v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere

v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well

Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-04 15:42:00 +00:00
Jussi Pakkanen 6f6afe24a7
Merge pull request #4326 from Ericson2314/per-machine
Start leveraging MachineInfo with for_* methods
2018-10-25 19:48:42 +03:00
Jussi Pakkanen 0a217f40d7 Detect powerpc processors on FreeBSD. Closes #4397. 2018-10-25 19:44:16 +03:00
Aki Van Ness 3ad99d2769 Added basic detection for AIX linker (not really a better way) 2018-10-17 10:45:52 +03:00
John Ericson 4efb361d47 Move some cross file parsing validition to MachineInfo
This is a domain-specific validation not tied to the surface syntax, so
it belongs here in the pipeline.
2018-10-14 20:20:06 +03:00
Mohammed Amer Khalidi 18204b8ed6 Adding "compiler_type" flag to ARM compilers. 2018-10-07 19:21:26 +03:00
John Ericson 68d0adf4d2 Rewrite `for_*` machine checks in terms of MachineInfo and phase out
It's much better to directly query the machine in question rather than
do some roundabout "is_cross" thing. This is the first step for much
natve- and cross- code path deduplication.
2018-10-05 23:31:16 -04:00
John Ericson 0b1fb51b66 MachineInfo: Make equality structural
For existing use cases, pointer equality sufficies, but structural is
much better going forward: these are intended to be immutable
descriptors of the machines.
2018-10-05 23:31:16 -04:00
John Ericson d69d2697cd Pull out essence total map essence of MachineInfos into PerMachine
We'll eventually have many other data structure duplicated for each
build, host, and target machines. This sets up the infrastructure for
that.
2018-10-05 23:31:15 -04:00
John Ericson 1c6b8b72cb Centralize description of build, host, and target, machines
Instead of just putting these together in the interpreter, put them
together in `environment.py` so Meson's implementation can also better
take advantage of them.
2018-10-05 00:14:44 +03:00
Masanori Kakura 99ecedc093 environment: Use os.path.basename() when checking mesonlib.meson_command
Without this, when one of Meson's parent directories contains
"python", unexpected option "-u" will be passed to Meson.
2018-09-25 20:38:35 -07:00
Ross Burton 89e0414efd environment: validate endian value from cross file
When reading the endian from a cross file, validate that the value is either
'big' or 'little'.
2018-09-25 02:42:49 +03:00
Alexey Brodkin 9453ac6182 mesonbuild: Recognise ARC architecture
-------------------------->8-----------------------
root@nsimhs:~# python

Python 2.7.15 (default, Sep 20 2018, 21:44:15)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import platform
>>> print platform.machine()
arc
-------------------------->8-----------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2018-09-23 11:22:38 +03:00
GoaLitiuM bc4bf03871 D: Fix incorrect arch handling in D linkers 2018-09-20 19:00:12 +03:00
David Seifert 8f16d0f3c9 Fix ICC on macOS 2018-09-16 18:27:19 +03:00
Jussi Pakkanen b9f229a494
Merge pull request #4175 from GoaLitiuM/d-archfixes
D: Improve target architecture handling
2018-09-16 14:40:55 +03:00
David Seifert 69ec001b06 Use enum instead of `int` for compiler variants
* Enums are strongly typed and make the whole
  `gcc_type`/`clang_type`/`icc_type` distinction
  redundant.
* Enums also allow extending via member functions,
  which makes the code more generalisable.
2018-09-16 00:47:32 +03:00
GoaLitiuM 5b0ad0f8ad Refactor D target architecture handling
The stored architecture matches the same format accepted by dub.
2018-09-14 05:18:50 +03:00
GoaLitiuM 8fa7c29661 D: Fix linker detection when static linker is missing
Fallback to using D compilers as static linkers when no suitable static linker were found.
2018-09-13 22:07:19 +03:00
FFY00 234bb45b02 d: fix how the DC variable is handled 2018-08-27 23:48:51 +03:00
Jussi Pakkanen 1ffc8de5e8
Merge pull request #3981 from GoaLitiuM/d-win-fixes
Fix D support on Windows
2018-08-27 22:30:23 +03:00
FFY00 ac07ae7d41 d: disallow dmd frontends (ldmd and gdc) 2018-08-27 00:57:35 +03:00
GoaLitiuM 82b38b6071 Fallback to LDC as static linker when not in MSVC build environment 2018-08-20 22:27:31 +03:00
GoaLitiuM 79f05b189a Follow target platform defined in MSVC environment for Windows D compilation 2018-08-20 22:27:31 +03:00
mohdamerkhalidi 28754ea621 Adding a new AR Linker Class for the ARM Compiler. (#3949) 2018-08-14 23:04:43 +03:00
Jussi Pakkanen 1b2f8acbeb Add support for s390x CPUs. Closes #3897. 2018-08-11 04:21:55 -07:00
John Ericson 9f5c84279e Fix bug and clarify error message in cross file validation
I believe the intent (from 30d0c2292f) is
that `[binaries]` isn't needed just for "target-only cross" (build ==
host != target). This fixes the code to match that, hopefully clarifying
the control flow in the process, and also improves the message to make
that clear.
2018-08-10 00:20:55 +03:00
George Koehler e0ed1ceae2 Refactor getting the host system of a cross compiler
Use mesonlib.for_windows or mesonlib.for_cygwin instead of
reimplementing them.

Add CrossBuildInfo.get_host_system to shorten the repeated the code in
the mesonlib.for_<platform> methods.
2018-08-07 04:19:35 -07:00
Jussi Pakkanen ecf4024592 Add 32 bit sparc processor support. Closes #3901. 2018-08-03 00:27:33 +03:00
Jussi Pakkanen e75f6e4305
Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacks
Be more permissive about not-found exe_wrapper
2018-07-31 19:33:06 +03:00
Nirbheek Chauhan 9e8566a277 Print a useful error when a compiler is not found in the cross file 2018-07-24 18:54:52 -07:00
Khem Raj 6fafbad6d5 mesonbuild: Recognise risc-v architecture
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-07-21 22:02:25 +03:00
Nirbheek Chauhan 416a00308f cross: Use ExternalProgram for cross-file exe_wrapper
We already have code to fetch and find binaries specified in a cross
file, so use the same code for exe_wrapper. This allows us to handle
the same corner-cases that were fixed for other cross binaries.
2018-07-09 04:09:46 +05:30
Nirbheek Chauhan 9bc9e9f306 Ask for more details when warning about unknown arch [skip appveyor] 2018-07-07 11:47:42 +03:00
Ross Burton e3e2e4ca14 Canonicalise 64-bit PowerPC CPU families to "ppc64"
Instead of exposing the endianness in the CPU family, canonicalise the CPU
family to just "ppc64" to match MIPS (which is also bi-endian).

Part of the work for #3842.
2018-07-07 11:47:42 +03:00
Jussi Pakkanen c08c8117ab Warn if compiler envvars point to cross compilers. Closes #3782. 2018-06-24 21:19:49 +03:00
Vasu Penugonda 7140afc0a8 Added ARMCLANG compiler support for C/C++ (#3717) 2018-06-21 00:55:39 +03:00
Ross Burton ecde1789b2 Validate cpu_family (#3753)
* environment: validate cpu_family in cross file

* run_unittests: add unittest to ensure CPU family list in docs and environment matches

* run_unittests: skip compiler options test if not in a git repository

* environment: validate the detected cpu_family

* docs: add 32-bit PowerPC and 32/64-bit MIPS to CPU Families table

Names gathered by booting Linux in Qemu and running:

$ python3
import platform; platform.machine()

Partial fix for #3751
2018-06-20 12:45:44 +00:00
Xavier Claessens 6ed7a31402 environment: copy self.cmd_line_options to not modify original options
That dict gets modified when adding default_options, but mesonmain will
need to keep the original values.
2018-06-06 20:02:37 +00:00
Xavier Claessens 7c4736d27f Convert args.projectoptions into a dict
This simplifies a lot of code, and centralize "key=value" parsing in a
single place.

Unknown command line options becomes an hard error instead of
merely printing warning message. It has been warning it would become an
hard error for a while now. This has exceptions though, any
unknown option starting with "<lang>_" or "b_" are ignored because they
depend on which languages gets added and which compiler gets selected.
Also any option for unknown subproject are ignored because they depend
on which subproject actually gets built.

Also write more command line parsing tests. "19 bad command line
options" is removed because bad cmd line option became hard error and
it's covered with new tests in "30 command line".
2018-06-06 20:02:37 +00:00
Xavier Claessens f4d60acaa9 Remove had_argument_for() it is not used anymore
This also means we don't need to keep original command line arguments
anymore.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8fb72510c3 Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a
coredata method.
2018-06-06 20:02:37 +00:00
Xavier Claessens fa72cd7173 Move get_args_from_envvars() from environment to compilers 2018-06-06 20:02:37 +00:00
Chun-wei Fan 3c4c8bf775 environment.py: Properly check platform on MSVC 2008
The 'Platform' envvar may not be set on Visual Studio 2008, at least
when using the SDK 7.0 compilers, so check the 'BUILD_PLAT' envvar so
that we do not mis-detect x64 build environments as x86.
2018-06-06 18:37:29 +00:00
Nirbheek Chauhan eb383ef4a2 Automatically add cross-mingw root and sysroot bindir to WINEPATH
This ensures that all the system DLLs required by executables such as
libstdc++-6.dll can be found out of the box and tests can run
2018-06-05 10:50:22 +00:00
Niklas Claesson 7fbab2c6e9 Update environment.py
Fix typo in environment.py
2018-06-04 23:46:14 +03:00
Nirbheek Chauhan 107e061506 Error out when someone tries to use msys/python to run Meson
This mistake seems to be a very common hiccup for people trying to use
Meson with MSYS2 on Windows from git or with pip.

msys/python uses POSIX paths with '/' as the root instead of a drive
like `C:/`, and also does not identify the platform as Windows.

This means that configure checks will be wrong, and many build tools
will be unable to parse the paths that are returned by functions in
Python such as shutil.which.

Closes https://github.com/mesonbuild/meson/issues/3653
2018-06-03 18:59:24 +00:00
Nirbheek Chauhan 0a035dea6d Set the meson command to use when we know what it is
Instead of using fragile guessing to figure out how to invoke meson,
set the value when meson is run. Also rework how we pass of
meson_script_launcher to regenchecker.py -- it wasn't even being used

With this change, we only need to guess the meson path when running
the tests, and in that case:

1. If MESON_EXE is set in the env, we know how to run meson
   for project tests.
2. MESON_EXE is not set, which means we run the configure in-process
   for project tests and need to guess what meson to run, so either
   - meson.py is found next to run_tests.py, or
   - meson, meson.py, or meson.exe is in PATH

Otherwise, you can invoke meson in the following ways:

1. meson is installed, and mesonbuild is available in PYTHONPATH:
   - meson, meson.py, meson.exe from PATH
   - python3 -m mesonbuild.mesonmain
   - python3 /path/to/meson.py
   - meson is a shell wrapper to meson.real
2. meson is not installed, and is run from git:
   - Absolute path to meson.py
   - Relative path to meson.py
   - Symlink to meson.py

All these are tested in test_meson_commands.py, except meson.exe since
that involves building the meson msi and installing it.
2018-06-01 19:20:04 +00:00
Nirbheek Chauhan a6c9f98c57 depfixer: We no longer run this as a script 2018-05-24 14:38:28 +00:00
Jussi Pakkanen e3be7f7021 Write coredata transactionally. Closes #3511. 2018-05-21 00:48:25 +03:00
Xavier Claessens 6de68e5201 Passing --default-library=both should override project value
Looks like this has always been broken, had_argument_for() was checking
if we have --default_library instead of --default-library.
2018-04-27 11:19:12 -04:00
Jussi Pakkanen c58dd64f8e Merged Arm CC support. 2018-04-16 23:02:09 +03:00
Jussi Pakkanen 86f725c1e5
Merge pull request #3115 from makise-homura/e2k-lcc-support
Support lcc compiler for e2k (Elbrus) architecture
2018-04-15 17:18:44 +03:00
makise-homura 495f47b12b Make more precise CPU detection for Elbrus platform 2018-04-12 22:40:53 +03:00
Jussi Pakkanen 3e23f36a3c Fix detection to work with newer Java compilers. 2018-04-02 12:20:45 +03:00
makise-homura 67f067d5b2 Added version detection for lcc compiler 2018-03-28 21:35:45 +03:00
Somasekhar Penugonda e62b8109eb Updates to CPP support and update review changes 2018-03-27 17:04:26 -05:00
makise-homura 7cc41baa98 Added Elbrus lcc compilers support as inheritance from gcc ones 2018-03-19 23:30:00 +03:00
Bedarkar, Malhar 831d1e4c2e - Updating cpp_std options similar to other compiler classes
- Updating environment.py for selecting '--vsn' option for armcc only.
- Updating build type arguments from GitHub pull request - 3157

Change-Id: Id3151e7715ec1016afdbd65391bb0d414ec7de13
2018-03-14 22:42:06 -05:00
Jussi Pakkanen ae0e469b06
Merge pull request #3145 from thejk/gcovr
Support gcovr >= 3.1 and add gcovr html report as fallback
2018-03-13 21:12:16 +02:00
Joel Klinghed dfc0655bcd fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1
Fix fail cases of detect_gcovr
2018-03-13 08:31:50 +01:00
Joel Klinghed ed8197207e fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1
Rename gcovr_3_1 to gcovr_new_rootdir
2018-03-12 22:18:26 +01:00
Bedarkar, Malhar a2ee76228e First cut of ARMCC support for MESON.
Change-Id: I15d8258e84d392baaccb8f670e33eefcfe8cd49a
2018-03-05 18:26:39 -06:00
Hemmo Nieminen 7fb8e518b2 Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle
data.
2018-03-01 01:06:51 +02:00
Hemmo Nieminen b0446075ec Remove some unused variables. 2018-03-01 01:06:51 +02:00
Joel Klinghed da01770261 Fix coverage-xml and coverage-text targets for gcovr >= 3.1
In gcovr 3.1 the -r/--rootdir argument changed meaning causing
reports generated with gcovr 3.1 to not find the source files
and look for *.gcda in the whole source tree rather than the
build dir.

So, detect gcovr version and if 3.1 give build_root to -r instead
of source_root.
2018-02-27 21:48:42 +01:00
Thibault Saunier c48b9594ff Add support for Visual Studio csc c# compiler 2018-02-25 01:10:52 +02:00
makise-homura 22a83817c8 Fixed syntax issues (for 'in' operator) 2018-02-21 18:29:25 +03:00
makise-homura 8236bed11b Support lcc compiler for e2k (Elbrus) architecture 2018-02-21 16:53:15 +03:00
Jon Turney f37692bedb Fix exception in 'test cases/failing/55 wrong shared crate type' when rustc is missing
Fix exception handling of missing rustc, by making it look like the other
compiler detectors

Traceback (most recent call last):
  File "/wip/meson/mesonbuild/environment.py", line 699, in detect_rust_compiler
    p, out = Popen_safe(compiler + ['--version'])[0:2]
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'rustc': 'rustc'

During handling of the above exception, another exception occurred:

[...]
  File "/wip/meson/mesonbuild/environment.py", line 701, in detect_rust_compiler
    popen_exceptions[compiler] = e
TypeError: unhashable type: 'list'
2018-02-15 12:51:25 +00:00
Jussi Pakkanen bfa6c8d074
Merge pull request #2938 from acfoltzer/rust-cross-merge
Add cross-compilation support for `rustc`
2018-02-04 00:44:09 +02:00
Adam C. Foltzer 1d81efb03d Add cross-compilation support for `rustc`
This patch is largely modeled on the relatively-straightforward code
for Fortran cross-compilation, so there might be some intricacies
missing.
2018-01-29 15:47:05 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Edward Betts bdfcecd2c6 Correct spelling mistakes. 2018-01-19 15:53:00 +02:00
Matthias Klumpp 5133d8650f d: Detect recent DMD compilers
They now are published by the D Language Foundation, and not Digital
Mars. Therefore, their signature has changed slightly.
(We can not check for 'DMD', because that string appears in every
compiler version output to denote the frontend version used by the
compiler).
2018-01-07 19:52:07 +02:00
Nirbheek Chauhan ae0f4ef055 compilers: Fix error when objc/objc++ compilers are not found
Earlier it would exit with a traceback:

UnboundLocalError: local variable 'out' referenced before assignment
2017-12-30 18:02:28 +02:00
Christoph Behle 7bd30c522b Fix flake8 issues. 2017-12-16 16:12:46 +01:00
Christoph Behle 1f3b41021d More version information for Fortran. 2017-12-16 15:38:31 +01:00
Christoph Behle 5b83894b77 More version information for D 2017-12-16 15:07:08 +01:00
Christoph Behle 783263b9f4 More version information for C# 2017-12-16 15:05:09 +01:00
Christoph Behle c6acf75617 More version information for compilers.
See issue #2762
Adds full_version to class Compiler. If set full_version will be printed
additionally.
Added support for CCompiler and CPPCompiler
Added support for gcc/g++, clang/clang++, icc.
2017-12-16 14:52:08 +01:00
Josh Soref 2b0505f222 spelling: targeting 2017-11-26 06:15:13 +00:00
Jussi Pakkanen 22adda1617 Review fixes. 2017-11-21 23:29:06 +02:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Nirbheek Chauhan d2a250412c compilers: Improve manual library searching
We can now specify the library type we want to search for, and whether
we want to prefer static libraries over shared ones or the other way
around. This functionality is not exposed to build files yet.
2017-11-11 23:06:48 +05:30
Elliott Sales de Andrade 6715087598 Dump coredata earlier.
Unfortunately, `time.time` and file timestamps are not guaranteed to be
in sync and due to various kernel caches may be different enough to
cause rebuilds to fail [1]. This was masked by older ninja versions that
could not read sub-second timestamps.

[1] https://travis-ci.org/mesonbuild/meson/jobs/296797872
2017-11-06 20:56:53 +02:00
Dylan Baker 4e394b3341 dependencies: Add function to strip system -L paths
PkgConfig automatically removes -L paths from libdirs if the -L points
to a system path. It knows what these paths are by taking this as a
configure option at build time, which the distro maintainers set
appropriately and everything works. This allows one to have two
versions of a package installed, a system and non system, and then
override PKG_CONFIG_PATH to use the non system version, and everything
just works. For non-pkgconfig dependencies (such as LLVM) meson needs to
strip these themselves to avoid breaking the above use case.
2017-10-21 10:36:00 -07:00
Nirbheek Chauhan 7c2ae55fab Revert "Revert "Merge pull request #1931 from centricular/use-patched-ninja""
This reverts commit 5eb64a6f3e.

Let's try again, with a fixed Ninja by QuLogic.
2017-09-18 18:40:24 +03:00
William D. Jones 48e7398add Check if Watcom version of cl exists in the path and avoid using it. (#2237) 2017-08-23 15:39:09 +03:00
Philippe Payant f83be23d55 Remove trailing spaces. 2017-08-23 15:22:02 +03:00
Philippe Payant fc92991e34 Fix detection of MSVC 2008 version. 2017-08-23 15:22:02 +03:00
Jussi Pakkanen 50fb7d37ab Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
2017-08-18 12:08:20 +03:00
YmrDtnJu 0929812eb5 Do not ignore stderr on gcc type check in get_gnu_compiler_defines.
As stderr may contain information the user can use to solve the problem with
the gcc installation, it should not be ignore but added to the error message.
2017-08-10 10:43:39 +03:00
Paulo Antonio Alvarez bc30ad6dba environment: Read VALAC from the environment and use it if set
The valac binary was hard coded in meson. We now check if VALAC is
defined in the environment, and if it is, use its value as the vala
compiler, if not, we proceed with the hard coded binary name.
2017-08-09 21:47:19 +03:00
Jussi Pakkanen 7f307fd5ef Update list of compiler executable names to try. 2017-07-31 07:08:07 -04:00
Jussi Pakkanen e89b6cdd10 Merge pull request #1374 from mesonbuild/simd
Add support for SIMD detection
2017-07-19 15:50:04 +03:00
Jussi Pakkanen db34a3a701 Close files reliably. 2017-07-18 00:33:08 +02:00
Jussi Pakkanen 5eb64a6f3e Revert "Merge pull request #1931 from centricular/use-patched-ninja"
This reverts commit aab7ada356, reversing
changes made to e1b24765af.
2017-07-18 00:30:52 +02:00
Nirbheek Chauhan afdaedea01 msvc: Split stderr by line and raise exception if empty
std.split() splits on whitespace, but we want the first line.
2017-07-17 19:20:00 +03:00
Jussi Pakkanen 8396c4f3e6 Added VS support to simd detector. 2017-07-17 19:15:04 +03:00
Nirbheek Chauhan e307865596 ninja backend: Detect ninja only once and log it
Needed for the CI, but good to have in general too.
2017-07-17 17:26:21 +05:30
Elliott Sales de Andrade b52955ff3d Run postconf scripts after dumping coredata.
MESONINTROSPECT is set when running postconf scripts, which implies that
introspection is possible. But it isn't really possible because coredata
hasn't been written yet. We also still need to make sure to delete
coredata if any postconf scripts fail.
2017-07-15 13:47:17 +02:00
Jehan d80787ae28 Output an appropriate warning when a cross info file does not exist.
If making a typo, it used to output:
>  Cross info file must have either host or a target machine.
This was not useful at all and looked like there could be a file format
error or some other issue with the content. Let's have an appropriate
error:
> File not found: /some/path
2017-07-02 10:08:08 -04:00
Nirbheek Chauhan 5dab5f1600 environment: Fix exception when no defines were found
Lists are not hashable.

Closes https://github.com/mesonbuild/meson/issues/1989
2017-06-26 14:16:13 -04:00
Alistair Thomas 117f4ab8b5 Split out languages from compilers.py 2017-06-23 00:42:41 +01:00
Alistair Thomas d71da5bdb3 Converted compilers.py to a sub-package 2017-06-22 20:12:42 +01:00
Alistair Thomas e5559903b3 Split linkers out from compilers.py 2017-06-22 20:09:58 +01:00
Jussi Pakkanen 7c03bfb463 Merged needs_exe_wrapper branch. 2017-06-07 20:09:43 +03:00
Alan 53e47d42f0 Set clang_type to CLANG_WIN on windows. 2017-06-03 23:45:59 +03:00
Ole André Vadla Ravnås b32c757073
environment: Add needs_exe_wrapper for overriding auto-detection.
This is useful when build_machine appears to be compatible with
host_machine, but actually isn't. For example when:
- build_machine is macOS and host_machine is the iOS Simulator
- the build_machine's libc is glibc but the host_machine libc is uClibc
- code relies on kernel features not available on the build_machine
2017-05-29 21:05:57 +02:00
Elliott Sales de Andrade 00f89b0f6e Fix undefined variables/methods. 2017-05-17 19:43:14 -04:00
Elliott Sales de Andrade 83d1c7f063 Rearrange trys to avoid possible undefined vars. 2017-05-17 05:37:02 -04:00
Elliott Sales de Andrade 65b1d33931 Remove unused imports. 2017-05-17 03:42:16 -04:00
Jussi Pakkanen b65b9fe271 More strict eval. 2017-05-01 19:30:55 +03:00
Dylan Baker 6944d06116 Don't use dict.keys() to check membership
It's much faster to do 'if a in dict' instead of 'if a in dict.keys()',
since the latter constructs an iterator and walks that iterator and then
tests equality at each step, and the former does a single hash lookup.
2017-04-28 22:42:39 +03:00