Commit Graph

16 Commits

Author SHA1 Message Date
Norbert Nemec 555847f20f Fix MSVC /link argument ordering (#5598)
* correct handling of LDFLAGS in find_library and sanity_check on MSVC (fixes #3629)

The MSVC compiler requires all linker flags to be placed after the compiler flags, separated by a "/link" argument. This was already handled for regular linking commands, but not yet for the aforementioned special code paths.

* on MSVC, add /link separator between compiler and linker flags when it is missing

* avoid unnecessary /link argument
2019-07-11 02:05:48 +03:00
Charlie Barto 687bd31317 Make faster w defender atp 2019-07-10 01:02:05 +03:00
Norbert Nemec cc3993d1d4 move Gnu-specific feature '--print-search-dirs' to GnuLikeCompiler 2019-07-07 23:12:54 +03:00
Jussi Pakkanen 74611ecb1f Fix unittests. 2019-07-05 22:27:10 +03:00
Marvin Scholz 5badc3912d compilers: Add missing cflags when calling compiler in link mode 2019-07-05 22:27:10 +03:00
Marvin Scholz 976c303603 compilers: Fix missing cflags for function detection
Fix #5481
2019-07-05 22:27:10 +03:00
Charlie Barto 1e182b51c6 Improve performance with windows defender ATP 2019-07-05 21:59:15 +03:00
Abhishek Pandit-Subedi 968aee4f18 Return zero in cross_sizeof
There is an error when compiling with -Werror=return-type. Non void
functions must return valid values.
2019-07-03 11:33:26 +03:00
Cody Schafer 11248eb203 sanitycheckc: avoid linking sanitycheckc when cross compiling 2019-06-27 20:36:09 +03:00
Marvin Scholz fa431dddbc compilers: Add logging for symbol prefix test
Currently meson does not write the outcome of this test to the log
file which makes debugging wrong outcomes of this incredibly tedious.
2019-06-13 22:40:16 +03:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
John Ericson 32e827dcdc Use `env.machines.*` to avoid some `is_cross`
This is a small example of the `is_cross` removal the that abstraction
enables.
2019-06-09 13:13:20 -04:00
Christoph Reiter 7ce9e56a4b Fix path splitting in get_compiler_dirs() with GCC/clang on Windows
It was using ':' as a path separator while GCC uses ';' resulting in bogus
paths being returned. Instead assume that the compiler uses the platform native
separator.

The previous splitting code still worked sometimes because splitting
"C:/foo;C:/bar" resulted in the last part "/bar" being valid if "<DriveOfCWD>:/bar"
existed.

The fix also exposes a clang Windows bug where it uses the wrong separator:
https://reviews.llvm.org/D61121 . Use a regex to fix those first.

This resulted in linker errors when statically linking against a library which
had an external dependency linking against system libs.

Fixes #5386
2019-05-16 23:05:49 +03:00
Dylan Baker f5ea341319 compilers/clike: ICL needs msvc workarounds in has_function 2019-05-13 11:22:31 -07:00
Dylan Baker cb70a20490 compilers: make keyword args to Compiler.compile keyword only
Becuase treating args as either keyword or positional makes inheritance
really awful to work with.
2019-05-10 13:51:24 -07:00
Dylan Baker 541523eeba compilers: Split C-Like functionality into a mixin classes
Currently C++ inherits C, which can lead to diamond problems. By pulling
the code out into a standalone mixin class that the C, C++, ObjC, and
Objc++ compilers can inherit and override as necessary we remove one
source of diamonding. I've chosen to split this out into it's own file
as the CLikeCompiler class is over 1000 lines by itself. This also
breaks the VisualStudio derived classes inheriting from each other, to
avoid the same C -> CPP inheritance problems. This is all one giant
patch because there just isn't a clean way to separate this.

I've done the same for Fortran since it effectively inherits the
CCompiler (I say effectively because was it actually did was gross
beyond explanation), it's probably not correct, but it seems to work for
now. There really is a lot of layering violation going on in the
Compilers, and a really good scrubbing would do this code a lot of good.
2019-05-03 10:36:50 -07:00