Commit Graph

52 Commits

Author SHA1 Message Date
Nirbheek Chauhan 45dbc0d30e find_library: Prefer .dll.a and .lib over .dll for shared
We can't know if the .lib is a static or import library, but that's
a problem in general too. The only way to figure out if a specific
file is an import or a static library is to dump its symbols and check
if it starts with __imp or not.

Even then, some libs are hybrid import and static, i.e., they contain
references to DLLs for some symbols and also provide implementations
for other symbols so this is a difficult problem.

Closes https://github.com/mesonbuild/meson/issues/2659
2017-12-03 10:06:11 +05:30
Jussi Pakkanen 554b484468
Merge pull request #2618 from mesonbuild/osxlinkerfixes
Fix many things have have been slightly broken in OSX
2017-12-03 02:25:44 +02:00
Ernestas Kulik e4f5fe1b35 vala: add stubs for thread flag methods
As the Vala compiler does not define thread_flags() and
thread_link_flags(), depending on threads in any capacity will cause Meson to
fail.

Fixes #2720.
2017-12-03 00:13:07 +02:00
Solomon Choina 2fdfb50da8 adding C++98 to versions that meson can support 2017-11-29 21:27:00 +02:00
Jussi Pakkanen fa6f01d096 Use absolute paths for rpaths on OSX. 2017-11-26 17:34:01 +02:00
Jussi Pakkanen 655137a74b Add headerpad linker argument on OSX. 2017-11-26 17:34:01 +02:00
Josh Soref 49f8d28ef5 spelling: overridden 2017-11-26 05:55:40 +00:00
Josh Soref 9dd4f047af spelling: occurrence 2017-11-26 05:55:13 +00:00
Jussi Pakkanen e51da1a34d
Merge pull request #2611 from mesonbuild/nirbheek/pkgconfig-msvc-static
Several fixes to pkg-config dependencies and the pkg-config module (try 3)
2017-11-15 22:51:34 +02:00
rkfg 87bf152e6e Fix #2620 2017-11-14 22:35:06 +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
Jussi Pakkanen 34d928a830 Better check for when address sanitizer is enabled. Closes #2590. 2017-11-09 21:14:42 +02:00
Alexis Jeandet dfab58772f Warn when no inc dir is found from parsing GNU compiler output
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-02 19:28:23 +01:00
Alexis Jeandet f15a57f31a Fix detection of include dirs with gnu compiler and non C locale
Auto detection was based on parsing gcc's output so we have to
ensure that it is always 'C'.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-01 15:08:23 +01:00
Niklas Claesson 09ccd0eeaa C/C++: Get default include dirs from compilers 2017-10-01 18:35:33 +02:00
Niklas Claesson 488e57332f VisualC: Add support for msvc toolset version 2017-10-01 18:35:33 +02:00
Jussi Pakkanen cf6693a4eb Linker flag for Windows GUI applications was missing on MSVC. 2017-09-26 21:46:32 +03:00
Jussi Pakkanen bea6b1a6f6 Merge pull request #2187 from centricular/fix-pcap-dependency
Fix pcap dependency, str.strip() now takes an argument, add cc.get_return_value()
2017-09-22 22:04:18 +03:00
Luke Shumaker bb25260f00 flake8: Perform suggested whitespace/formatting changes
This only touches newlines, spaces, and (occaisionally) commas.  Anything
else is left for another commit.
2017-09-21 11:59:03 -04:00
Nirbheek Chauhan 59473e9ed7 Add a new compiler method: get_return_value()
This method accepts a single function that takes no arguments and
returns a single value which can be a value that can be cast to
a 64-bit signed integer, or a string, and returns that value.

Mostly useful for running foolib_version() functions that return the
currently-available version of libraries.
2017-09-20 13:36:42 +05:30
Alexis Jeandet e553d0807b Last round with listify function refactoring.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:25:34 +02:00
Matthias Klumpp 6cd3f066b4 d: Implement specific properties for D features 2017-09-12 17:32:03 +02:00
Matthias Klumpp d83c289442 d: Add easy way to use D-specific features
Of course D compilers have different flags to set some important
D-specific settings. This adds a simple method to change these flags in
a compiler-agnostic way in Meson.

This replaces the previous `unittest_args` method with a more generic
variant.
2017-09-12 17:32:03 +02:00
Daniel Stone e1ffae0580 Add Compiler.get_supported_arguments()
Add a helper for the common pattern of:
  args_to_use = []
  foreach arg : candidate_args
    if cc.has_argument(arg)
      args_to_use += arg
    endif
  endforeach

Replaced with:
  args_to_use = cc.get_supported_arguments(candidate_args)
2017-08-31 20:24:20 +01:00
Peter Harris ee34f454ca Fix detection of clang "optimization arguments"
In version 3.6.0, clang added -Wignored-optimization-argument. Without
setting this flag to -Werror, "ignored optimization arguments" such as
(for example) -fpeel-loops, are accepted but warned about, leading to
noisy builds if meson thinks the flag is supported.

See also #755
2017-08-18 12:11:20 +03:00
Nirbheek Chauhan 5764a26a4c gfortran: Add coverage arguments 2017-08-15 01:38:01 +05:30
Gabríel Arthúr Pétursson 0ad448f890 Pass -fpch-preprocess to GCC when precompiled headers are used
CCache requires this flag when building with precompiled headers.
Without it, the preprocessor fails and CCache fallbacks to running the
real compiler.

Users still need to set 'sloppiness' to 'pch_defines,time_macros' in
their ccache.conf file for CCache to cache builds that use precompiled
headers. See the CCache manual for more info:

	https://ccache.samba.org/manual.html#_precompiled_headers
2017-08-13 21:24:28 +03:00
Elliott Sales de Andrade 17b051c8b1 Add info on module include flag for Fortran compilers. 2017-08-04 20:07:08 -04:00
Jussi Pakkanen d335a84b9e A few more lgtm fixes. 2017-08-04 12:54:31 +03:00
Jussi Pakkanen 0ab9f23061 Add thread flags to checks if needed. Closes #2106. 2017-08-01 19:09:07 -04:00
Ben 0ed0bcce49 Vala: enable colored warning and error output (#2142) 2017-08-01 06:22:17 -04:00
Nirbheek Chauhan de2d59cc27 find_library: Ignore libs on MSVC properly
In addition to filtering libs out while generating the command-line, we
must also filter them out in find_library() otherwise these libs will be
detected as "found" on Windows with MSVC.

Closes https://github.com/mesonbuild/meson/issues/1509
2017-07-23 02:12:00 +03:00
Nirbheek Chauhan b3d048e93a CompilerArgs: Put start/end-group around shared libs too
Closes https://github.com/mesonbuild/meson/issues/2096
2017-07-23 02:07:04 +03:00
Jussi Pakkanen bff37a90fc Merged buildrpath branch. 2017-07-21 22:19:07 +03:00
Alessandro Decina a9559e0d77 Fix linking Objective-C shared libs on OSX.
This commit amends 04a2e6de making
linker.get_std_shared_lib_link_args() always return -shared for
SharedLibrary(es) instead of -bundle. SharedModule(s) get linked with
linker.get_std_shared_module_link_args() which already correctly returns
-bundle.

Before this change -bundle and -install_name ended up being emitted
for Objective-C shared libraries, which caused a linking error.
2017-07-21 20:36:50 +03:00
Jussi Pakkanen 2269b7f60b Add build_rpath as new property allowing people to specify rpath entries that are used in the build tree but will be removed on install. 2017-07-21 19:40:54 +03:00
Jussi Pakkanen ce77fb89b9 Renamed test case number to avoid dupes. 2017-07-17 19:53:00 +03:00
Jussi Pakkanen 181510bd6e Fix checks on MinGW and VS2010. 2017-07-17 19:19:24 +03:00
Jussi Pakkanen 8396c4f3e6 Added VS support to simd detector. 2017-07-17 19:15:04 +03:00
Jussi Pakkanen 16ec3f0e19 Fix a few OSX "features". 2017-07-17 19:09:04 +03:00
Jussi Pakkanen d304aac504 Created simd module. 2017-07-17 19:06:16 +03:00
Chocobo1 24c2e4d3ac Fix typo
profile guide optimization -> profile guided optimization
2017-07-16 11:54:03 +02:00
Hemmo Nieminen 09a5399d09 Fix how rpath directories are handled.
Linking a library from a directory below the executable's directory caused
an invalid path to be written in the executable's RPATH.
2017-07-15 13:44:07 +02:00
Gabríel Arthúr Pétursson 39c7b0492c Allow both address- and undefined behavior sanitizers at the same time 2017-07-15 09:59:09 +02:00
Hemmo Nieminen ea79e94964 Fix a missing path issue causing Python traceback.
A path was missing from a call to os.path.relpath when handling rpaths.
Fix this by assuming empty target directory means build root.
2017-06-29 13:16:38 +03:00
Jussi Pakkanen dfb0414d9c Merged Genie support. 2017-06-27 19:01:00 +03:00
Guillaume Poirier-Morency bbddf51a54 Use 'C sharp' instead of 'C#'
The '#' is reserved for Ninja comments and cannot be escaped.
2017-06-26 20:03:52 -04:00
Guillaume Poirier-Morency 5b58ff2783 compilers: Use 'get_display_language' for language-related exceptions 2017-06-26 20:03:52 -04:00
Guillaume Poirier-Morency fab5634916 Add 'Compiler.get_display_language'
Use this when we print language-related information to the console and
via the Ninja backend.
2017-06-26 14:15:44 -04:00
Alistair Thomas cca0fa8154 Recognise .gs extension as a Vala source 2017-06-26 13:57:52 +01:00