Commit Graph

14 Commits

Author SHA1 Message Date
Nirbheek Chauhan 64a0dc6269 Implement cc.find_library for the Visual Studio C/C++ compilers
Without this find_library always succeeds because MSVC just ignores -lfoo
as an invalid argument
2016-03-18 02:58:02 +05:30
Jussi Pakkanen 8b6848ebc3 Add dir support for find_library and remove deprecated standalone version. Closes #450. 2016-03-17 20:55:19 +02:00
Jussi Pakkanen 9c5bda3f40 Return array by value so it does not get modified. 2016-03-12 17:32:43 +02:00
Jussi Pakkanen 6b548a1c75 Added find_library method and deprecated the standalone version. Closes #396. 2016-03-12 17:00:55 +02:00
Jussi Pakkanen c6138fe8bd .ipp is a C++ header suffix. 2016-02-26 22:52:36 +02:00
Nirbheek Chauhan d95a108503 compilers: MSVC does not understand the -lfoo syntax
MSVC requires import libraries called foo.lib for linking to foo.dll, so
translate -lfoo to that. If foo.lib doesn't exist, linking will fail as
expected.
2016-02-21 13:44:43 +02:00
Martin Ejdestig a179d07fd1 Do not pass -Weverything to Clang at warning level 3
-Weverything is not a good match for behavior of other compilers at warning
level 3. Align flags with what Meson passes to GCC instead.

The warnings generated are often conflicting with what the user most
probably wants. E.g.:

* -Wc++98-compat does not make sense when building code that uses -std= to
  set a later standard.

* -Wpadding warns when compiler pads classes and structs for better
  performance, probably something the user wants.

These warnings, and maybe a couple of others, can of course be disabled by
Meson with -Wno-* but it is not future proof (other warnings that makes
sense to disable by default may be added which means Meson will probably
have to pass different flags depending on the Clang version).

It is also problematic to compile many system and library headers with
-Weverything. For instance:

* stdio.h and sigaction.h on Linux makes use of recursive macros
  (-Wdisabled-macro-expansion).

* Many library headers make use of deprecated functionality (-Wdeprecated).

* Many library (e.g. GTK+ and Qt) headers trigger Clang's Doxygen warnings
  (-Wdocumentation-unknown-command and -Wdocumentation).

There are a couple of more warnings that need to be disabled when building
files that use GTK+ and Qt. GTest is also problematic.

Maybe it would make sense to add a higher level, where -Weverything would
be passed to Clang, that aligns with the original intent of -Weverything.
See http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20121029/067071.html .
GCC does not have a similar flag though. I do not know about other
compilers (MSVC etc).
2016-02-20 21:51:32 +01:00
Jussi Pakkanen 53e90acda9 Fix Vala cross compilation. Closes #370. 2016-02-17 22:15:32 +02:00
Nirbheek Chauhan deff35eef6 Filter out UNIX flags from external deps when using the MSVC compiler
This is very useful to prevent compiler noise about invalid cflags; particularly
for the -mms-bitfields cflag which most libraries send to the mingw-gcc
compiler. More can be added later.
2016-02-17 20:22:34 +02:00
Nirbheek Chauhan 3dd039487e compilers: /LD is not needed for PIC support in DLLs
On Windows, the advantages of PIC are provided by the runtime DLL loader. /LD is
also only valid as an argument to cl.exe, and the linker link.exe just barfs
when it sees it.

The code assumes that the compiler is the same as the linker which caused this
problem to occur.
2016-02-17 19:49:31 +02:00
Nirbheek Chauhan 3fcd056e86 compilers: Don't pass /D for debugoptimized build type
/D is the same as -D and stands for define not debug. Passing this would swallow
the next argument.
2016-02-17 14:28:19 +05:30
Jussi Pakkanen 819da091c2 Use deterministic mode in ar when it is available. 2016-02-12 23:42:20 +02:00
Jussi Pakkanen 6a3e29ccd4 If test exes can not be removed (because e.g. an antivirus program holds on to the file), just leave them behind. Closes #378. 2016-02-03 13:27:58 +11:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00