Commit Graph

527 Commits

Author SHA1 Message Date
bcf20af62e environment: Add support for MinGW/GCC to detect_windows_arch() 2016-09-27 00:27:38 +05:30
a001fa0fb6 compilers: Make GCC detection more robust on all platforms
Fixes https://github.com/mesonbuild/meson/issues/650

Also adds new has_define and get_define internal API for querying
pre-processor defines provided by GNU compilers.
2016-09-27 00:27:38 +05:30
ac8c8c2ba8 Treat 32-bit compiles on 64-bit Windows as native
It's a terrible user experience to force people building 32-bit
applications on 64-bit Windows to use a cross-info file when every other
tool treats it as a 'native' compilation -- it satisfies all the
requirements for a native compile.

This commit also fixes the platform detection on Windows which would
cause the 'native cpu' to be detected as 32-bit if you installed 32-bit
Python on 64-bit Windows, or if you were building with a 32-bit
toolchain on 64-bit Windows.

Doesn't support MinGW yet -- the next commits will add that since the
changes required for that are more involved.
2016-09-26 19:48:46 +05:30
6590b7221e intrp: Parse project() before the rest of the AST
We need the compiler and language information stored in it for
populating the BuildMachine() properties accurately. The next commits
add this.
2016-09-26 19:48:46 +05:30
4ceaa395b5 compilers: Populate Rust and Vala compiler ids
These two have only one implementation, so just name them as they are
2016-09-26 19:48:46 +05:30
b89c52e844 compilers: Remove duplicate class methods
These can just be implemented by the base Compiler class
2016-09-26 19:48:46 +05:30
ece29e32a8 compilers: Consolidate language suffix mapping
Instead of spreading it across the entire file and re-implementing
can_compile for each compiler, consolidate it in one dictionary which
the base compiler class can refer to based on self.language set by the
child class.

This has fixed a number of hidden and unreported bugs due to bitrotten
can_compiler implementations.
2016-09-26 19:48:46 +05:30
5ebc77f722 i18n: use POTFILES.in as fallback if there's no POTFILES in po dir
In autotools POTFILES is generated at configure time from POTFILES.in,
but Meson only looks for a po/POTFILES in the source directory, which
is awkward when trying to maintain both build systems in parallel.
Instead just use POTFILES.in as fallback if it exists but POTFILES
does not. Also print an error if neither exists.

Fixes #818
2016-09-25 20:06:02 +01:00
e23e5c48d7 Use custom target outputs to determine linker. Closes #786. 2016-09-25 19:20:26 +03:00
cb2eff8440 ninja: Fix checking of exe_wrapper for CustomTargets (#806)
It was making a trivially incorrect check
2016-09-25 19:06:04 +03:00
9c6369c759 interpreter: Print an error if the fallback dependency variable is not found (#804) 2016-09-25 19:03:18 +03:00
5b34e560e5 gnome: Print useful error if missing compile_resource arg (#811) 2016-09-25 19:02:41 +03:00
3aebdb717a configuration_data: can pass descriptions to setters (#783)
Add support for passing a description to configuration data
setter methods via a 'description' kwarg. The description
string will be used when meson generates the entire configure
file without a template, autoconf-style.
2016-09-25 18:56:49 +03:00
84d4dc3bbb Merge pull request #812 from centricular/older-gcc-pedantic
compilers: Fall back to -pedantic with older GCC
2016-09-25 18:52:05 +03:00
8784c35dde Give a helpful exception when target has no name (#816) 2016-09-25 18:50:55 +03:00
89d3a18f65 Add a meson.version() method returning the version of meson in use (#792)
So user can activate/deactivate features based on it.
2016-09-25 18:49:36 +03:00
e8dc13248e compilers: Fix typo in visual studio warning argument 2016-09-25 09:41:07 +05:30
e459fd2f53 compilers: Fall back to -pedantic with older GCC
Fixes https://github.com/mesonbuild/meson/issues/242
2016-09-25 07:53:49 +05:30
f1b6c89d9c Option for ndebug. 2016-09-16 21:51:29 +03:00
a2e7ebc575 Add a new 'environment' object to be used to build test environment (#781)
Allowing user to fine tune tests environment variables
2016-09-14 23:11:27 +03:00
8fd8c16a87 Merge pull request #782 from tp-m/config-data-set-quoted
config data: add .set_quoted() convenience method to set quoted string
2016-09-14 22:16:09 +03:00
7d24f96d2d Merge pull request #774 from mesonbuild/compilerreorg
Move compiler common functionality to own class
2016-09-14 19:12:09 +03:00
3d8876bf59 Download without status updates if server does not report file size. Closes #771. 2016-09-14 19:09:57 +03:00
09fdc7f815 configuration_data: add .set_quoted() convenience method to set quoted string
Quotes in the string will be escaped C-string style with \", but
nothing else will be escaped.
2016-09-13 23:44:33 +01:00
49583ccfab Revert #737. Closes #773. 2016-09-12 21:54:49 +03:00
c970d656b1 All_args should always be a list. Closes #778. 2016-09-11 15:02:48 +03:00
c334eeda76 Merge pull request #684 from mesonbuild/pdb
Create pdb files with MSVC
2016-09-11 13:04:55 +03:00
0840a908f2 ninjabackend: Add support for installing .pdb files
.pdb files are files created by MSVC which have debug symbols. These are
created when /ZI or /Zi is passed to the compiler and /DEBUG to the
linker.
2016-09-11 10:10:47 +05:30
4228a6dab6 vs: Never serialize debug file generation with /FS
/FS forces .pdb file writing to be serialized through MSPDBSRV.EXE,
which is supposed to solve concurrency issues (esp. with anti-viruses),
but it doesn't actually always work. It also isn't needed anymore since
we don't use a shared vcXXX.pdb temporary file for pdb writing and use
/Fd to explicitly set a per-target pdb filename instead.

Not serializing the PDB writing will make a large difference on fast
disks when linking multiple libraries and executables simultaneously.
2016-09-11 10:10:46 +05:30
167deda665 module pkgconfig: added install_dir attribute (#776)
the pkgconfig module automatically specified to install the
pkgconfig file to {libdir}/pkgconfig. Default settings in meson
already include multiarch-directories like x86_64-gnu-linux into
the libdir. pkgconfig usually does not check inside multiarch-dirs
for any pkgconfig-files.
to make this a bit more flexible, this commit introduces the
install_dir attribute for pkgconfig.generate. if it is set, the
default install path will be overridden by the users input
2016-09-11 00:20:49 +03:00
873558b2b4 Reorganisation. 2016-09-10 17:41:01 +03:00
e57c626337 Clang C++ compiler uses common class. 2016-09-10 17:39:03 +03:00
20083c0694 Factored Clang common stuff in its own class. 2016-09-10 17:19:51 +03:00
26f9adf6a6 Moved base options to base class, because they are always the same. 2016-09-10 17:07:18 +03:00
5833d23e76 Made objc compilers use Gnu class. 2016-09-10 17:05:20 +03:00
85c2f67079 Made C++ compiler use GNU class. 2016-09-10 17:00:00 +03:00
2336624f4a Refactored GNU common functionality into its own class. 2016-09-10 16:56:22 +03:00
c7e5e558f9 More PDB explanation. 2016-09-10 13:26:37 +03:00
19ecad5b24 Mark all dependencies for run targets. 2016-09-09 02:02:23 +03:00
6f2b29e0f7 Can use files() in run_command. 2016-09-08 21:51:48 +03:00
b1e4b8e143 Merge pull request #768 from mesonbuild/rtfixes
Fixes for run_targets
2016-09-08 21:51:05 +03:00
5d30ea99ea meson_test: Add env variables to the test logs file (#767)
So users can more easily reproduce the test without the
launcher
2016-09-08 21:50:19 +03:00
d26ab47072 Can use custom targets as executables to run in a run_target. 2016-09-07 23:14:14 +03:00
9235fd4ec1 Permit use of file objects in run targets. 2016-09-07 23:04:11 +03:00
3f62fb788b Remove unneeded shebang line that was triggering some linters. 2016-09-07 22:06:33 +03:00
b6ee5725c2 Fix option initialization for win32 cross-compile. (#762) 2016-09-07 21:42:16 +03:00
165f8a913d Better error message when trying to use subprojects as dependencies. 2016-09-07 21:25:34 +03:00
69433025ca Update version for new development. 2016-09-05 23:23:09 +03:00
c013298426 Update version number for release. 2016-09-05 22:23:44 +03:00
b289547971 Force clang to error out on unknown arguments. Closes #755. 2016-09-04 22:28:25 +03:00